home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / leland.c < prev    next >
C/C++ Source or Header  |  2000-05-25  |  118KB  |  3,561 lines

  1. /***************************************************************************
  2.  
  3.     Cinemat/Leland driver
  4.  
  5.     driver by Aaron Giles and Paul Leaman
  6.  
  7.     -------------------------------------
  8.  
  9.     To enter service mode in most games, press 1P start and then press
  10.     the service switch (F2).
  11.  
  12.     For Redline Racer, hold the service switch down and reset the machine.
  13.  
  14.     For Super Offroad, press the blue nitro button (3P button 1) and then
  15.     press the service switch.
  16.  
  17.     -------------------------------------
  18.  
  19.     Still to do:
  20.         - memory map
  21.         - generate fake serial numbers
  22.         - kludge Quarterback sound
  23.         - work around Alley Master crash if you enter no name
  24.             and the battery ram is cleared to all 0
  25.  
  26. ***************************************************************************/
  27.  
  28.  
  29. #include "driver.h"
  30.  
  31. #include "vidhrdw/generic.h"
  32. #include "machine/eeprom.h"
  33.  
  34. #include "cpu/z80/z80.h"
  35.  
  36.  
  37. /* define these to 0 to disable, or to 1 to enable */
  38. #define LOG_KEYCARDS        0
  39. #define LOG_KEYCARDS_FULL    0
  40. #define LOG_BANKSWITCHING_M    0
  41. #define LOG_BANKSWITCHING_S    0
  42. #define LOG_SOUNDPORT        0
  43. #define LOG_EEPROM            0
  44. #define LOG_BATTERY_RAM        0
  45.  
  46.  
  47. /* Helps document the input ports. */
  48. #define IPT_SLAVEHALT     IPT_SPECIAL
  49. #define IPT_EEPROM_DATA    IPT_SPECIAL
  50. #define PORT_SERVICE_NO_TOGGLE(mask,default)    \
  51.     PORT_BITX(    mask, mask & default, IPT_SERVICE1, DEF_STR( Service_Mode ), KEYCODE_F2, IP_JOY_NONE )
  52.  
  53.  
  54. static UINT8 leland_gfx_control;
  55. UINT8 leland_dac_control;
  56.  
  57. static UINT8 wcol_enable;
  58.  
  59. static void *master_int_timer;
  60.  
  61. static UINT8 *master_base;
  62. static UINT8 *slave_base;
  63. static UINT32 master_length;
  64. static UINT32 slave_length;
  65.  
  66. static int dangerz_x, dangerz_y;
  67. static UINT8 analog_result;
  68. static UINT8 dial_last_input[4];
  69. static UINT8 dial_last_result[4];
  70.  
  71. static UINT8 keycard_shift;
  72. static UINT8 keycard_bit;
  73. static UINT8 keycard_state;
  74. static UINT8 keycard_clock;
  75. static UINT8 keycard_command[3];
  76.  
  77. static UINT8 top_board_bank;
  78. static UINT8 sound_port_bank;
  79. static UINT8 alternate_bank;
  80. static void (*update_master_bank)(void);
  81.  
  82. #define battery_ram_size 0x4000
  83. static UINT8 battery_ram_enable;
  84. static UINT8 *battery_ram;
  85.  
  86. static UINT8 eeprom_data[64*2];
  87. static struct EEPROM_interface eeprom_interface =
  88. {
  89.     6,
  90.     16,
  91.     "110",
  92.     "101",
  93.     "111"
  94. };
  95.  
  96.  
  97. /* Sound routines */
  98. WRITE_HANDLER( leland_i86_control_w );
  99. WRITE_HANDLER( leland_i86_command_lo_w );
  100. WRITE_HANDLER( leland_i86_command_hi_w );
  101. READ_HANDLER( leland_i86_response_r );
  102.  
  103. int  leland_sh_start(const struct MachineSound *msound);
  104. void leland_sh_stop(void);
  105.  
  106. int  leland_i186_sh_start(const struct MachineSound *msound);
  107. int  redline_i186_sh_start(const struct MachineSound *msound);
  108. void leland_i186_sound_init(void);
  109.  
  110. void leland_i86_optimize_address(offs_t offset);
  111.  
  112. extern struct MemoryReadAddress leland_i86_readmem[];
  113. extern struct MemoryWriteAddress leland_i86_writemem[];
  114. extern struct IOReadPort leland_i86_readport[];
  115. extern struct IOWritePort redline_i86_writeport[];
  116. extern struct IOWritePort leland_i86_writeport[];
  117.  
  118. /* Video routines */
  119. READ_HANDLER( leland_mvram_port_r );
  120. READ_HANDLER( leland_svram_port_r );
  121. WRITE_HANDLER( leland_mvram_port_w );
  122. WRITE_HANDLER( leland_svram_port_w );
  123. WRITE_HANDLER( leland_master_video_addr_w );
  124. WRITE_HANDLER( leland_slave_video_addr_w );
  125.  
  126. WRITE_HANDLER( leland_gfx_port_w );
  127.  
  128. void leland_vh_eof(void);
  129. int leland_vh_start(void);
  130. void leland_vh_stop(void);
  131. void leland_vh_screenrefresh(struct osd_bitmap *bitmap, int full_refresh);
  132.  
  133. /* Internal routines */
  134. static void interrupt_callback(int scanline);
  135.  
  136.  
  137.  
  138. /*************************************
  139.  *
  140.  *    Generic dial encoding
  141.  *
  142.  *************************************/
  143.  
  144. static int dial_compute_value(int new_val, int indx)
  145. {
  146.     int delta = new_val - (int)dial_last_input[indx];
  147.     UINT8 result = dial_last_result[indx] & 0x80;
  148.  
  149.     dial_last_input[indx] = new_val;
  150.  
  151.     if (delta > 0x80)
  152.         delta -= 0x100;
  153.     else if (delta < -0x80)
  154.         delta += 0x100;
  155.  
  156.     if (delta < 0)
  157.     {
  158.         result = 0x80;
  159.         delta = -delta;
  160.     }
  161.     else if (delta > 0)
  162.         result = 0x00;
  163.  
  164.     if (delta > 0x1f)
  165.         delta = 0x1f;
  166.     result |= (dial_last_result[indx] + delta) & 0x1f;
  167.  
  168.     dial_last_result[indx] = result;
  169.     return result;
  170. }
  171.  
  172.  
  173.  
  174. /*************************************
  175.  *
  176.  *    Cerberus inputs
  177.  *
  178.  *************************************/
  179.  
  180. static READ_HANDLER( cerberus_dial_1_r )
  181. {
  182.     int original = readinputport(0);
  183.     int modified = dial_compute_value(readinputport(4), 0);
  184.     return (original & 0xc0) | ((modified & 0x80) >> 2) | (modified & 0x1f);
  185. }
  186.  
  187. static READ_HANDLER( cerberus_dial_2_r )
  188. {
  189.     int original = readinputport(2);
  190.     int modified = dial_compute_value(readinputport(5), 1);
  191.     return (original & 0xc0) | ((modified & 0x80) >> 2) | (modified & 0x1f);
  192. }
  193.  
  194.  
  195.  
  196. /*************************************
  197.  *
  198.  *    Alley Master inputs
  199.  *
  200.  *************************************/
  201.  
  202. static UINT8 *alleymas_kludge_mem;
  203.  
  204. static WRITE_HANDLER( alleymas_joystick_kludge )
  205. {
  206.     /* catch the case where they clear this memory location at PC $1827 and change */
  207.     /* the value written to be a 1 */
  208.     if (cpu_getpreviouspc() == 0x1827)
  209.         *alleymas_kludge_mem = 1;
  210.     else
  211.         *alleymas_kludge_mem = data;
  212.  
  213.     /* while we're here, make sure the first 3 characters in battery RAM are a */
  214.     /* valid name; otherwise, it will crash if you start a game and don't enter */
  215.     /* your name */
  216.     if (battery_ram[0] == 0)
  217.     {
  218.         battery_ram[0] = 'C';
  219.         battery_ram[1] = 'I';
  220.         battery_ram[2] = 'N';
  221.     }
  222. }
  223.  
  224.  
  225.  
  226. /*************************************
  227.  *
  228.  *    Danger Zone inputs
  229.  *
  230.  *************************************/
  231.  
  232. static void update_dangerz_xy(void)
  233. {
  234.     UINT8 newy = readinputport(4);
  235.     UINT8 newx = readinputport(5);
  236.     int deltay = newy - dial_last_input[0];
  237.     int deltax = newx - dial_last_input[1];
  238.  
  239.     if (deltay <= -128) deltay += 256;
  240.     else if (deltay >= 128) deltay -= 256;
  241.     if (deltax <= -128) deltax += 256;
  242.     else if (deltax >= 128) deltax -= 256;
  243.  
  244.     dangerz_y += deltay;
  245.     dangerz_x += deltax;
  246.     if (dangerz_y < 0) dangerz_y = 0;
  247.     else if (dangerz_y >= 1024) dangerz_y = 1023;
  248.     if (dangerz_x < 0) dangerz_x = 0;
  249.     else if (dangerz_x >= 1024) dangerz_x = 1023;
  250.  
  251.     dial_last_input[0] = newy;
  252.     dial_last_input[1] = newx;
  253. }
  254.  
  255. static READ_HANDLER( dangerz_input_y_r )
  256. {
  257.     update_dangerz_xy();
  258.     return dangerz_y & 0xff;
  259. }
  260.  
  261. static READ_HANDLER( dangerz_input_x_r )
  262. {
  263.     update_dangerz_xy();
  264.     return dangerz_x & 0xff;
  265. }
  266.  
  267. static READ_HANDLER( dangerz_input_upper_r )
  268. {
  269.     update_dangerz_xy();
  270.     return ((dangerz_y >> 2) & 0xc0) | ((dangerz_x >> 8) & 0x03);
  271. }
  272.  
  273.  
  274.  
  275. /*************************************
  276.  *
  277.  *    Red Line Racer inputs
  278.  *
  279.  *************************************/
  280.  
  281. static const UINT8 redline_pedal_value[8] = { 0xf0, 0xe0, 0xc0, 0xd0, 0x90, 0xb0, 0x30, 0x70 };
  282.  
  283. static READ_HANDLER( redline_pedal_1_r )
  284. {
  285.     int pedal = readinputport(0);
  286.     return redline_pedal_value[pedal >> 5] | 0x0f;
  287. }
  288.  
  289. static READ_HANDLER( redline_pedal_2_r )
  290. {
  291.     int pedal = readinputport(2);
  292.     return redline_pedal_value[pedal >> 5] | 0x0f;
  293. }
  294.  
  295. static READ_HANDLER( redline_wheel_1_r )
  296. {
  297.     return dial_compute_value(readinputport(4), 0);
  298. }
  299.  
  300. static READ_HANDLER( redline_wheel_2_r )
  301. {
  302.     return dial_compute_value(readinputport(5), 1);
  303. }
  304.  
  305.  
  306.  
  307. /*************************************
  308.  *
  309.  *    Super Offroad inputs
  310.  *
  311.  *************************************/
  312.  
  313. static READ_HANDLER( offroad_wheel_1_r )
  314. {
  315.     return dial_compute_value(readinputport(7), 0);
  316. }
  317.  
  318. static READ_HANDLER( offroad_wheel_2_r )
  319. {
  320.     return dial_compute_value(readinputport(8), 1);
  321. }
  322.  
  323. static READ_HANDLER( offroad_wheel_3_r )
  324. {
  325.     return dial_compute_value(readinputport(9), 2);
  326. }
  327.  
  328.  
  329.  
  330. /*************************************
  331.  *
  332.  *    Machine initialization
  333.  *
  334.  *************************************/
  335.  
  336. static void init_machine(void)
  337. {
  338.     /* set the odd data bank */
  339.     battery_ram = memory_region(REGION_USER2);
  340.  
  341.     /* start scanline interrupts going */
  342.     master_int_timer = timer_set(cpu_getscanlinetime(8), 8, interrupt_callback);
  343.  
  344.     /* reset globals */
  345.     leland_gfx_control = 0;
  346.     wcol_enable = 0;
  347.  
  348.     dangerz_x = 512;
  349.     dangerz_y = 512;
  350.     analog_result = 0xff;
  351.     memset(dial_last_input, 0, sizeof(dial_last_input));
  352.     memset(dial_last_result, 0, sizeof(dial_last_result));
  353.  
  354.     keycard_shift = 0;
  355.     keycard_bit = 0;
  356.     keycard_state = 0;
  357.     keycard_clock = 0;
  358.     memset(keycard_command, 0, sizeof(keycard_command));
  359.  
  360.     top_board_bank = 0;
  361.     sound_port_bank = 0;
  362.     alternate_bank = 0;
  363.  
  364.     /* initialize the master banks */
  365.     master_length = memory_region_length(REGION_CPU1);
  366.     master_base = memory_region(REGION_CPU1);
  367.     (*update_master_bank)();
  368.  
  369.     /* initialize the slave banks */
  370.     slave_length = memory_region_length(REGION_CPU2);
  371.     slave_base = memory_region(REGION_CPU2);
  372.     if (slave_length > 0x10000)
  373.         cpu_setbank(3, &slave_base[0x10000]);
  374.  
  375.     /* if we have an I86 CPU, reset it */
  376.     if ((Machine->drv->cpu[2].cpu_type & ~CPU_FLAGS_MASK) == CPU_I186)
  377.         leland_i186_sound_init();
  378. }
  379.  
  380.  
  381.  
  382. /*************************************
  383.  *
  384.  *    Master CPU interrupt handling
  385.  *
  386.  *************************************/
  387.  
  388. static void interrupt_callback(int scanline)
  389. {
  390.     extern UINT8 leland_last_scanline_int;
  391.     leland_last_scanline_int = scanline;
  392.  
  393.     /* interrupts generated on the VA10 line, which is every */
  394.     /* 16 scanlines starting with scanline #8 */
  395.     cpu_cause_interrupt(0, 0);
  396.  
  397.     /* set a timer for the next one */
  398.     scanline += 16;
  399.     if (scanline > 248)
  400.         scanline = 8;
  401.     master_int_timer = timer_set(cpu_getscanlinetime(scanline), scanline, interrupt_callback);
  402. }
  403.  
  404.  
  405. static int master_interrupt(void)
  406. {
  407.     /* check for coins here */
  408.     if ((readinputport(1) & 0x0e) != 0x0e)
  409.         cpu_set_nmi_line(0, ASSERT_LINE);
  410.  
  411.     /* generate an interrupt if requested */
  412.     return ignore_interrupt();
  413. }
  414.  
  415.  
  416. static READ_HANDLER( master_nmi_clear_r )
  417. {
  418.     cpu_set_nmi_line(0, CLEAR_LINE);
  419.     return 0;
  420. }
  421.  
  422.  
  423.  
  424. /*************************************
  425.  *
  426.  *    Master CPU bankswitch handlers
  427.  *
  428.  *************************************/
  429.  
  430. static WRITE_HANDLER( master_alt_bankswitch_w )
  431. {
  432.     /* update any bankswitching */
  433.     if (LOG_BANKSWITCHING_M)
  434.         if ((alternate_bank ^ data) & 0x0f)
  435.             logerror("%04X:alternate_bank = %02X\n", cpu_getpreviouspc(), data & 0x0f);
  436.     alternate_bank = data & 15;
  437.     (*update_master_bank)();
  438.  
  439.     /* sound control is in the rest */
  440.     leland_i86_control_w(offset, data);
  441. }
  442.  
  443.  
  444. /* bankswitching for Cerberus */
  445. static void cerberus_bankswitch(void)
  446. {
  447.     /* no bankswitching */
  448. }
  449.  
  450.  
  451. /* bankswitching for Mayhem 2002, World Series Baseball, and Alley Master */
  452. static void mayhem_bankswitch(void)
  453. {
  454.     UINT8 *address;
  455.  
  456.     battery_ram_enable = ((sound_port_bank & 0x24) == 0);
  457.  
  458.     address = (!(sound_port_bank & 0x04)) ? &master_base[0x10000] : &master_base[0x1c000];
  459.     cpu_setbank(1, address);
  460.  
  461.     address = battery_ram_enable ? battery_ram : &address[0x8000];
  462.     cpu_setbank(2, address);
  463. }
  464.  
  465.  
  466. /* bankswitching for Danger Zone */
  467. static void dangerz_bankswitch(void)
  468. {
  469.     UINT8 *address;
  470.  
  471.     battery_ram_enable = ((top_board_bank & 0x80) != 0);
  472.  
  473.     address = (!(alternate_bank & 1)) ? &master_base[0x02000] : &master_base[0x12000];
  474.     cpu_setbank(1, address);
  475.  
  476.     address = battery_ram_enable ? battery_ram : &address[0x8000];
  477.     cpu_setbank(2, address);
  478. }
  479.  
  480.  
  481. /* bankswitching for Baseball the Season II, Super Baseball, and Strike Zone */
  482. static void basebal2_bankswitch(void)
  483. {
  484.     UINT8 *address;
  485.  
  486.     battery_ram_enable = (top_board_bank & 0x80);
  487.  
  488.     if (!battery_ram_enable)
  489.         address = (!(sound_port_bank & 0x04)) ? &master_base[0x10000] : &master_base[0x1c000];
  490.     else
  491.         address = (!(top_board_bank & 0x40)) ? &master_base[0x28000] : &master_base[0x30000];
  492.     cpu_setbank(1, address);
  493.  
  494.     address = battery_ram_enable ? battery_ram : &address[0x8000];
  495.     cpu_setbank(2, address);
  496. }
  497.  
  498.  
  499. /* bankswitching for Red Line Racer */
  500. static void redline_bankswitch(void)
  501. {
  502.     static const UINT32 bank_list[] = { 0x10000, 0x18000, 0x02000, 0x02000 };
  503.     UINT8 *address;
  504.  
  505.     battery_ram_enable = ((alternate_bank & 3) == 1);
  506.  
  507.     address = &master_base[bank_list[alternate_bank & 3]];
  508.     cpu_setbank(1, address);
  509.  
  510.     address = battery_ram_enable ? battery_ram : &master_base[0xa000];
  511.     cpu_setbank(2, address);
  512. }
  513.  
  514.  
  515. /* bankswitching for Viper, Quarterback, Team Quarterback, and All American Football */
  516. static void viper_bankswitch(void)
  517. {
  518.     static const UINT32 bank_list[] = { 0x02000, 0x10000, 0x18000, 0x02000 };
  519.     UINT8 *address;
  520.  
  521.     battery_ram_enable = ((alternate_bank & 0x04) != 0);
  522.  
  523.     address = &master_base[bank_list[alternate_bank & 3]];
  524.     if (bank_list[alternate_bank & 3] >= master_length)
  525.     {
  526.         logerror("%04X:Master bank %02X out of range!\n", cpu_getpreviouspc(), alternate_bank & 3);
  527.         address = &master_base[bank_list[0]];
  528.     }
  529.     cpu_setbank(1, address);
  530.  
  531.     address = battery_ram_enable ? battery_ram : &master_base[0xa000];
  532.     cpu_setbank(2, address);
  533. }
  534.  
  535.  
  536. /* bankswitching for Super Offroad, Super Offroad Track Pack, and Pig Out */
  537. static void offroad_bankswitch(void)
  538. {
  539.     static const UINT32 bank_list[] = { 0x02000, 0x02000, 0x10000, 0x18000, 0x20000, 0x28000, 0x30000, 0x38000 };
  540.     UINT8 *address;
  541.  
  542.     battery_ram_enable = ((alternate_bank & 7) == 1);
  543.  
  544.     address = &master_base[bank_list[alternate_bank & 7]];
  545.     if (bank_list[alternate_bank & 7] >= master_length)
  546.     {
  547.         logerror("%04X:Master bank %02X out of range!\n", cpu_getpreviouspc(), alternate_bank & 7);
  548.         address = &master_base[bank_list[0]];
  549.     }
  550.     cpu_setbank(1, address);
  551.  
  552.     address = battery_ram_enable ? battery_ram : &master_base[0xa000];
  553.     cpu_setbank(2, address);
  554. }
  555.  
  556.  
  557.  
  558. /*************************************
  559.  *
  560.  *    EEPROM handling (64 x 16bits)
  561.  *
  562.  *************************************/
  563.  
  564. #define SERIAL_TYPE_NONE        0
  565. #define SERIAL_TYPE_ADD            1
  566. #define SERIAL_TYPE_ENCRYPT        2
  567. #define SERIAL_TYPE_ENCRYPT_XOR    3
  568.  
  569. static void init_eeprom(UINT8 default_val, const UINT16 *data, UINT8 serial_offset, UINT8 serial_type)
  570. {
  571.     UINT32 serial;
  572.  
  573.     /* initialize everything to the default value */
  574.     memset(eeprom_data, default_val, sizeof(eeprom_data));
  575.  
  576.     /* fill in the preset data */
  577.     while (*data != 0xffff)
  578.     {
  579.         int offset = *data++;
  580.         int value = *data++;
  581.         eeprom_data[offset * 2 + 0] = value >> 8;
  582.         eeprom_data[offset * 2 + 1] = value & 0xff;
  583.     }
  584.  
  585.     /* pick a serial number -- examples of real serial numbers:
  586.  
  587.         Team QB:      21101957
  588.         AAFB:         26101119 and 26101039
  589.     */
  590.     serial = 0x12345678;
  591.  
  592.     /* switch off the serial number type */
  593.     switch (serial_type)
  594.     {
  595.         case SERIAL_TYPE_ADD:
  596.         {
  597.             int i;
  598.             for (i = 0; i < 10; i++)
  599.             {
  600.                 int digit;
  601.  
  602.                 if (i >= 8)
  603.                     digit = 0;
  604.                 else
  605.                     digit = ((serial << (i * 4)) >> 28) & 15;
  606.                 digit = ('0' + digit) * 2;
  607.                 eeprom_data[serial_offset * 2 +  0 + (i ^ 1)] = digit / 3;
  608.                 eeprom_data[serial_offset * 2 + 10 + (i ^ 1)] = digit / 3;
  609.                 eeprom_data[serial_offset * 2 + 20 + (i ^ 1)] = digit - (2 * (digit / 3));
  610.             }
  611.             break;
  612.         }
  613.  
  614.         case SERIAL_TYPE_ENCRYPT:
  615.         case SERIAL_TYPE_ENCRYPT_XOR:
  616.         {
  617.             int d, e, h, l;
  618.  
  619.             /* break the serial number out into pieces */
  620.             l = (serial >> 24) & 0xff;
  621.             h = (serial >> 16) & 0xff;
  622.             e = (serial >> 8) & 0xff;
  623.             d = serial & 0xff;
  624.  
  625.             /* decrypt the data */
  626.             h = ((h ^ 0x2a ^ l) ^ 0xff) + 5;
  627.             d = ((d + 0x2a) ^ e) ^ 0xff;
  628.             l ^= e;
  629.             e ^= 0x2a;
  630.  
  631.             /* optionally XOR the result */
  632.             if (serial_type == SERIAL_TYPE_ENCRYPT_XOR)
  633.             {
  634.                 h ^= 0xff;
  635.                 l ^= 0xff;
  636.                 d ^= 0xff;
  637.                 e ^= 0xff;
  638.             }
  639.  
  640.             /* store the bytes */
  641.             eeprom_data[serial_offset * 2 + 0] = h;
  642.             eeprom_data[serial_offset * 2 + 1] = l;
  643.             eeprom_data[serial_offset * 2 + 2] = d;
  644.             eeprom_data[serial_offset * 2 + 3] = e;
  645.             break;
  646.         }
  647.     }
  648.  
  649.     EEPROM_init(&eeprom_interface);
  650. }
  651.  
  652.  
  653.  
  654. /*************************************
  655.  *
  656.  *    Battery backed RAM
  657.  *
  658.  *************************************/
  659.  
  660. static WRITE_HANDLER( battery_ram_w )
  661. {
  662.     if (battery_ram_enable)
  663.     {
  664.         if (LOG_BATTERY_RAM) logerror("%04X:BatteryW@%04X=%02X\n", cpu_getpreviouspc(), offset, data);
  665.         battery_ram[offset] = data;
  666.     }
  667.     else
  668.         logerror("%04X:BatteryW@%04X (invalid!)\n", cpu_getpreviouspc(), offset, data);
  669. }
  670.  
  671.  
  672. static void nvram_handler(void *file, int read_or_write)
  673. {
  674.     if (read_or_write)
  675.     {
  676.         EEPROM_save(file);
  677.         osd_fwrite(file, memory_region(REGION_USER2), battery_ram_size);
  678.     }
  679.     else if (file)
  680.     {
  681.         EEPROM_load(file);
  682.         osd_fread(file, memory_region(REGION_USER2), battery_ram_size);
  683.     }
  684.     else
  685.     {
  686.         EEPROM_set_data(eeprom_data, 64*2);
  687.         memset(memory_region(REGION_USER2), 0x00, battery_ram_size);
  688.     }
  689. }
  690.  
  691.  
  692.  
  693. /*************************************
  694.  *
  695.  *    Master CPU keycard I/O
  696.  *
  697.  ************************************/
  698.  
  699. /*--------------------------------------------------------------------
  700.  
  701.   A note about keycards:
  702.  
  703.   These were apparently static programmable ROMs that could be
  704.   inserted into certain games. The games would then save/load
  705.   statistics on them.
  706.  
  707.   The data is accessed via a serial protocol, which is
  708.   implemented below. There are two known commands that are
  709.   written; each command is 3 bytes and accesses 128 bytes of
  710.   data from the keycard:
  711.  
  712.           62 00 80
  713.           9D 00 80
  714.  
  715.   the last byte appears to specify the length of data to transfer.
  716.  
  717.   The format of the data on the card is pretty heavily encrypted.
  718.   The first 7 bytes read serves as a header:
  719.  
  720.           D5 43 49 4E 2A xx yy
  721.  
  722.   where xx is a game-specific key, and yy is the complement of the
  723.   key. For example, World Series Baseball uses 04/FB. Alley Master
  724.   uses 05/FA.
  725.  
  726.   The last 112 bytes of data is encrypted via the following method:
  727.  
  728.         for (i = 16, b = 0x70, r = 0x08; i < 128; i++, b--, r += 0x10)
  729.         {
  730.             UINT8 a = original_data[i] ^ 0xff;
  731.             a = (a >> 3) | (a << 5);
  732.             a = (((a ^ r) + 1 + b) ^ b) - b;
  733.             encrypted_data[i] = a;
  734.         }
  735.  
  736.   The data that is encrypted is stored alternating with a checksum
  737.   byte. The checksum for a value A is ((A ^ 0xa5) + 0x27) ^ 0x34.
  738.  
  739. --------------------------------------------------------------------*/
  740.  
  741. static int keycard_r(void)
  742. {
  743.     int result = 0;
  744.  
  745.     if (LOG_KEYCARDS_FULL) logerror("  (%04X:keycard_r)\n", cpu_getpreviouspc());
  746.  
  747.     /* if we have a valid keycard read state, we're reading from the keycard */
  748.     if (keycard_state & 0x80)
  749.     {
  750.         /* clock in new data */
  751.         if (keycard_bit == 1)
  752.         {
  753.             keycard_shift = 0xff;    /* no data, but this is where we would clock it in */
  754.             if (LOG_KEYCARDS) logerror("  (clocked in %02X)\n", keycard_shift);
  755.         }
  756.  
  757.         /* clock in the bit */
  758.         result = (~keycard_shift & 1) << ((keycard_state >> 4) & 3);
  759.         if (LOG_KEYCARDS) logerror("  (read %02X)\n", result);
  760.     }
  761.     return result;
  762. }
  763.  
  764. static void keycard_w(int data)
  765. {
  766.     int new_state = data & 0xb0;
  767.     int new_clock = data & 0x40;
  768.  
  769.     if (LOG_KEYCARDS_FULL) logerror("  (%04X:keycard_w=%02X)\n", cpu_getpreviouspc(), data);
  770.  
  771.     /* check for going active */
  772.     if (!keycard_state && new_state)
  773.     {
  774.         keycard_command[0] = keycard_command[1] = keycard_command[2] = 0;
  775.         if (LOG_KEYCARDS) logerror("keycard going active (state=%02X)\n", new_state);
  776.     }
  777.  
  778.     /* check for going inactive */
  779.     else if (keycard_state && !new_state)
  780.     {
  781.         keycard_command[0] = keycard_command[1] = keycard_command[2] = 0;
  782.         if (LOG_KEYCARDS) logerror("keycard going inactive\n");
  783.     }
  784.  
  785.     /* check for clocks */
  786.     else if (keycard_state == new_state)
  787.     {
  788.         /* work off of falling edge */
  789.         if (!new_clock && keycard_clock)
  790.         {
  791.             keycard_shift >>= 1;
  792.             keycard_bit = (keycard_bit + 1) & 7;
  793.         }
  794.  
  795.         /* look for a bit write */
  796.         else if (!new_clock && !keycard_clock && !(data & 0x80))
  797.         {
  798.             if (LOG_KEYCARDS) logerror("  (write %02X)\n", data);
  799.  
  800.             keycard_shift &= ~0x80;
  801.             if (data & (1 << ((new_state >> 4) & 3)))
  802.                 keycard_shift |= 0x80;
  803.  
  804.             /* clock out the data on the last bit */
  805.             if (keycard_bit == 7)
  806.             {
  807.                 if (LOG_KEYCARDS) logerror("  (clocked out %02X)\n", keycard_shift);
  808.                 keycard_command[0] = keycard_command[1];
  809.                 keycard_command[1] = keycard_command[2];
  810.                 keycard_command[2] = keycard_shift;
  811.                 if (keycard_command[0] == 0x62 && keycard_command[1] == 0x00 && keycard_command[2] == 0x80)
  812.                 {
  813.                     if (LOG_KEYCARDS) logerror("  (got command $62)\n");
  814.                 }
  815.             }
  816.         }
  817.     }
  818.  
  819.     /* error case */
  820.     else
  821.     {
  822.         /* only an error if the selected bit changes; read/write transitions are okay */
  823.         if ((new_state & 0x30) != (keycard_state & 0x30))
  824.             if (LOG_KEYCARDS) logerror("ERROR: Caught keycard state transition %02X -> %02X\n", keycard_state, new_state);
  825.     }
  826.  
  827.     keycard_state = new_state;
  828.     keycard_clock = new_clock;
  829. }
  830.  
  831.  
  832.  
  833. /*************************************
  834.  *
  835.  *    Master CPU analog and keycard I/O
  836.  *
  837.  *************************************/
  838.  
  839. static READ_HANDLER( master_analog_key_r )
  840. {
  841.     int result = 0;
  842.  
  843.     switch (offset)
  844.     {
  845.         case 0x00:    /* FD = analog data read */
  846.             result = analog_result;
  847.             break;
  848.  
  849.         case 0x01:    /* FE = analog status read */
  850.             /* bit 7 indicates the analog input is busy for some games */
  851.             result = 0x00;
  852.             break;
  853.  
  854.         case 0x02:    /* FF = keycard serial data read */
  855.             result = keycard_r();
  856.  
  857.             /* bit 7 indicates the analog input is busy for some games */
  858.             result &= ~0x80;
  859.             break;
  860.     }
  861.     return result;
  862. }
  863.  
  864.  
  865.  
  866. static WRITE_HANDLER( master_analog_key_w )
  867. {
  868.     switch (offset)
  869.     {
  870.         case 0x00:    /* FD = analog port trigger */
  871.             break;
  872.  
  873.         case 0x01:    /* FE = analog port select/bankswitch */
  874.             analog_result = readinputport((data & 15) + 4);
  875.  
  876.             /* update top board banking for some games */
  877.             if (LOG_BANKSWITCHING_M)
  878.                 if ((top_board_bank ^ data) & 0xc0)
  879.                     logerror("%04X:top_board_bank = %02X\n", cpu_getpreviouspc(), data & 0xc0);
  880.             top_board_bank = data & 0xc0;
  881.             (*update_master_bank)();
  882.             break;
  883.  
  884.         case 0x02:    /* FF = keycard data write */
  885.             keycard_w(data);
  886.             break;
  887.     }
  888. }
  889.  
  890.  
  891.  
  892. /*************************************
  893.  *
  894.  *    Master CPU internal I/O
  895.  *
  896.  *************************************/
  897.  
  898. static READ_HANDLER( master_input_r )
  899. {
  900.     int result = 0xff;
  901.  
  902.     switch (offset)
  903.     {
  904.         case 0x00:    /* /GIN0 */
  905.             result = readinputport(0);
  906.             break;
  907.  
  908.         case 0x01:    /* /GIN1 */
  909.             result = readinputport(1);
  910.             if (cpunum_get_reg(1, Z80_HALT))
  911.                 result ^= 0x01;
  912.             break;
  913.  
  914.         case 0x02:    /* /GIN2 */
  915.         case 0x12:
  916.             cpu_set_nmi_line(0, CLEAR_LINE);
  917.             break;
  918.  
  919.         case 0x03:    /* /IGID */
  920.         case 0x13:
  921.             result = AY8910_read_port_0_r(offset);
  922.             break;
  923.  
  924.         case 0x10:    /* /GIN0 */
  925.             result = readinputport(2);
  926.             break;
  927.  
  928.         case 0x11:    /* /GIN1 */
  929.             result = readinputport(3);
  930.             if (LOG_EEPROM) logerror("%04X:EE read\n", cpu_getpreviouspc());
  931.             result = (result & ~0x01) | EEPROM_read_bit();
  932.             break;
  933.  
  934.         default:
  935.             logerror("Master I/O read offset %02X\n", offset);
  936.             break;
  937.     }
  938.     return result;
  939. }
  940.  
  941.  
  942. static WRITE_HANDLER( master_output_w )
  943. {
  944.     switch (offset)
  945.     {
  946.         case 0x09:    /* /MCONT */
  947.             cpu_set_reset_line(1,    (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
  948.             wcol_enable = (data & 0x02);
  949.             cpu_set_nmi_line  (1,    (data & 0x04) ? CLEAR_LINE : ASSERT_LINE);
  950.             cpu_set_irq_line  (1, 0, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
  951.  
  952.             if (LOG_EEPROM) logerror("%04X:EE write %d%d%d\n", cpu_getpreviouspc(),
  953.                     (data >> 6) & 1, (data >> 5) & 1, (data >> 4) & 1);
  954.             EEPROM_write_bit     ((data & 0x10) >> 4);
  955.             EEPROM_set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
  956.             EEPROM_set_cs_line  ((~data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
  957.             break;
  958.  
  959.         case 0x0a:    /* /OGIA */
  960.             AY8910_control_port_0_w(0, data);
  961.             break;
  962.  
  963.         case 0x0b:    /* /OGID */
  964.             AY8910_write_port_0_w(0, data);
  965.             break;
  966.  
  967.         case 0x0c:    /* /BKXL */
  968.         case 0x0d:    /* /BKXH */
  969.         case 0x0e:    /* /BKYL */
  970.         case 0x0f:    /* /BKYH */
  971.             leland_gfx_port_w(offset - 0x0c, data);
  972.             break;
  973.  
  974.         default:
  975.             logerror("Master I/O write offset %02X=%02X\n", offset, data);
  976.             break;
  977.     }
  978. }
  979.  
  980.  
  981.  
  982. /*************************************
  983.  *
  984.  *    Master CPU palette gates
  985.  *
  986.  *************************************/
  987.  
  988. static WRITE_HANDLER( gated_paletteram_w )
  989. {
  990.     if (wcol_enable)
  991.         paletteram_BBGGGRRR_w(offset, data);
  992. }
  993.  
  994.  
  995. static READ_HANDLER( gated_paletteram_r )
  996. {
  997.     if (wcol_enable)
  998.         return paletteram_r(offset);
  999.     return 0xff;
  1000. }
  1001.  
  1002.  
  1003.  
  1004. /*************************************
  1005.  *
  1006.  *    AY8910-controlled graphics latch
  1007.  *
  1008.  *************************************/
  1009.  
  1010. static READ_HANDLER( sound_port_r )
  1011. {
  1012.     return leland_gfx_control;
  1013. }
  1014.  
  1015.  
  1016. static WRITE_HANDLER( sound_port_w )
  1017. {
  1018.     int gfx_banks = Machine->gfx[0]->total_elements / 0x400;
  1019.     int gfx_bank_mask = (gfx_banks - 1) << 4;
  1020.     int diff = data ^ leland_gfx_control;
  1021.  
  1022.     /* update the graphics banking if necessary */
  1023.     if ((diff & 0x08) || (diff & gfx_bank_mask))
  1024.         leland_gfx_port_w(-1, data);
  1025.  
  1026.     /* set the new value */
  1027.     leland_gfx_control = data;
  1028.     leland_dac_control &= data & 3;
  1029.  
  1030.     /* some bankswitching occurs here */
  1031.     if (LOG_BANKSWITCHING_M)
  1032.         if ((sound_port_bank ^ data) & 0x24)
  1033.             logerror("%04X:sound_port_bank = %02X\n", cpu_getpreviouspc(), data & 0x24);
  1034.     sound_port_bank = data & 0x24;
  1035.     (*update_master_bank)();
  1036. }
  1037.  
  1038.  
  1039.  
  1040. /*************************************
  1041.  *
  1042.  *    Slave CPU bankswitching
  1043.  *
  1044.  *************************************/
  1045.  
  1046. static WRITE_HANDLER( slave_small_banksw_w )
  1047. {
  1048.     int bankaddress = 0x10000 + 0xc000 * (data & 1);
  1049.  
  1050.     if (bankaddress >= slave_length)
  1051.     {
  1052.         logerror("%04X:Slave bank %02X out of range!", cpu_getpreviouspc(), data & 1);
  1053.         bankaddress = 0x10000;
  1054.     }
  1055.     cpu_setbank(3, &slave_base[bankaddress]);
  1056.  
  1057.     if (LOG_BANKSWITCHING_S) logerror("%04X:Slave bank = %02X (%05X)\n", cpu_getpreviouspc(), data & 1, bankaddress);
  1058. }
  1059.  
  1060.  
  1061. static WRITE_HANDLER( slave_large_banksw_w )
  1062. {
  1063.     int bankaddress = 0x10000 + 0x8000 * (data & 15);
  1064.  
  1065.     if (bankaddress >= slave_length)
  1066.     {
  1067.         logerror("%04X:Slave bank %02X out of range!", cpu_getpreviouspc(), data & 15);
  1068.         bankaddress = 0x10000;
  1069.     }
  1070.     cpu_setbank(3, &slave_base[bankaddress]);
  1071.  
  1072.     if (LOG_BANKSWITCHING_S) logerror("%04X:Slave bank = %02X (%05X)\n", cpu_getpreviouspc(), data & 15, bankaddress);
  1073. }
  1074.  
  1075.  
  1076.  
  1077. /*************************************
  1078.  *
  1079.  *    Slave CPU I/O
  1080.  *
  1081.  *************************************/
  1082.  
  1083. static READ_HANDLER( raster_r )
  1084. {
  1085.     int scanline = cpu_getscanline();
  1086.     return (scanline < 255) ? scanline : 255;
  1087. }
  1088.  
  1089.  
  1090.  
  1091. /*************************************
  1092.  *
  1093.  *    Master CPU memory handlers
  1094.  *
  1095.  *************************************/
  1096.  
  1097. static struct MemoryReadAddress master_readmem[] =
  1098. {
  1099.     { 0x0000, 0x1fff, MRA_ROM },
  1100.     { 0x2000, 0x9fff, MRA_BANK1 },
  1101.     { 0xa000, 0xdfff, MRA_BANK2 },
  1102.     { 0xe000, 0xefff, MRA_RAM },
  1103.     { 0xf000, 0xf3ff, gated_paletteram_r },
  1104.     { -1 }  /* end of table */
  1105. };
  1106.  
  1107. static struct MemoryWriteAddress master_writemem[] =
  1108. {
  1109.     { 0x0000, 0x9fff, MWA_ROM },
  1110.     { 0xa000, 0xdfff, battery_ram_w },
  1111.     { 0xe000, 0xefff, MWA_RAM },
  1112.     { 0xf000, 0xf3ff, gated_paletteram_w, &paletteram },
  1113.     { 0xf800, 0xf801, leland_master_video_addr_w },
  1114.     { -1 }  /* end of table */
  1115. };
  1116.  
  1117. static struct IOReadPort master_readport[] =
  1118. {
  1119.     { 0xf2, 0xf2, leland_i86_response_r },
  1120.     { 0xfd, 0xff, master_analog_key_r },
  1121.     { -1 }  /* end of table */
  1122. };
  1123.  
  1124. static struct IOWritePort master_writeport[] =
  1125. {
  1126.     { 0xf0, 0xf0, master_alt_bankswitch_w },
  1127.     { 0xf2, 0xf2, leland_i86_command_lo_w },
  1128.     { 0xf4, 0xf4, leland_i86_command_hi_w },
  1129.     { 0xfd, 0xff, master_analog_key_w },
  1130.     { -1 }  /* end of table */
  1131. };
  1132.  
  1133.  
  1134.  
  1135. /*************************************
  1136.  *
  1137.  *    Slave CPU memory handlers
  1138.  *
  1139.  *************************************/
  1140.  
  1141. static struct MemoryReadAddress slave_small_readmem[] =
  1142. {
  1143.     { 0x0000, 0x1fff, MRA_ROM },
  1144.     { 0x2000, 0xdfff, MRA_BANK3 },
  1145.     { 0xe000, 0xefff, MRA_RAM },
  1146.     { 0xf802, 0xf802, raster_r },
  1147.     { -1 }  /* end of table */
  1148. };
  1149.  
  1150. static struct MemoryWriteAddress slave_small_writemem[] =
  1151. {
  1152.     { 0x0000, 0xdfff, MWA_ROM },
  1153.     { 0xe000, 0xefff, MWA_RAM },
  1154.     { 0xf800, 0xf801, leland_slave_video_addr_w },
  1155.     { 0xf803, 0xf803, slave_small_banksw_w },
  1156.     { -1 }  /* end of table */
  1157. };
  1158.  
  1159. static struct MemoryReadAddress slave_large_readmem[] =
  1160. {
  1161.     { 0x0000, 0x1fff, MRA_ROM },
  1162.     { 0x4000, 0xbfff, MRA_BANK3 },
  1163.     { 0xe000, 0xefff, MRA_RAM },
  1164.     { 0xf802, 0xf802, raster_r },
  1165.     { -1 }  /* end of table */
  1166. };
  1167.  
  1168. static struct MemoryWriteAddress slave_large_writemem[] =
  1169. {
  1170.     { 0x0000, 0xbfff, MWA_ROM },
  1171.     { 0xc000, 0xc000, slave_large_banksw_w },
  1172.     { 0xe000, 0xefff, MWA_RAM },
  1173.     { 0xf800, 0xf801, leland_slave_video_addr_w },
  1174.     { -1 }  /* end of table */
  1175. };
  1176.  
  1177. static struct IOReadPort slave_readport[] =
  1178. {
  1179.     { 0x00, 0x1f, leland_svram_port_r },
  1180.     { 0x40, 0x5f, leland_svram_port_r },
  1181.     { -1 }  /* end of table */
  1182. };
  1183.  
  1184. static struct IOWritePort slave_writeport[] =
  1185. {
  1186.     { 0x00, 0x1f, leland_svram_port_w },
  1187.     { 0x40, 0x5f, leland_svram_port_w },
  1188.     { -1 }  /* end of table */
  1189. };
  1190.  
  1191.  
  1192. /*************************************
  1193.  *
  1194.  *    Port definitions
  1195.  *
  1196.  *************************************/
  1197.  
  1198. INPUT_PORTS_START( cerberus )        /* complete, verified from code */
  1199.     PORT_START      /* 0x80 */
  1200.     PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_SPECIAL | IPF_PLAYER1 )
  1201.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  1202.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
  1203.  
  1204.     PORT_START      /* 0x81 */
  1205.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLAVEHALT )
  1206.     PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
  1207.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
  1208.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
  1209.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  1210.  
  1211.     PORT_START      /* 0x90 */
  1212.     PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_SPECIAL | IPF_PLAYER2 )
  1213.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  1214.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  1215.  
  1216.     PORT_START      /* 0x91 */
  1217.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_EEPROM_DATA )
  1218.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
  1219.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 | IPF_PLAYER1 )
  1220.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 | IPF_PLAYER1 )
  1221.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  1222.  
  1223.     PORT_START      /* Analog joystick 1 */
  1224.     PORT_ANALOG( 0xff, 0, IPT_DIAL | IPF_PLAYER1, 50, 10, 0, 0 )
  1225.     PORT_START
  1226.     PORT_ANALOG( 0xff, 0, IPT_DIAL | IPF_PLAYER2, 50, 10, 0, 0 )
  1227.     PORT_START      /* Analog joystick 2 */
  1228.     PORT_START
  1229.     PORT_START      /* Analog joystick 3 */
  1230.     PORT_START
  1231. INPUT_PORTS_END
  1232.  
  1233.  
  1234. INPUT_PORTS_START( mayhem )        /* complete, verified from code */
  1235.     PORT_START      /* 0xC0 */
  1236.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
  1237.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  1238.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER2 )
  1239.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  1240.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
  1241.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  1242.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER1 )
  1243.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
  1244.  
  1245.     PORT_START      /* 0xC1 */
  1246.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLAVEHALT )
  1247.     PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
  1248.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
  1249.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
  1250.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  1251.  
  1252.     PORT_START      /* 0xD0 */
  1253.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  1254.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  1255.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  1256.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  1257.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  1258.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  1259.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  1260.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
  1261.  
  1262.     PORT_START      /* 0xD1 */
  1263.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_EEPROM_DATA )
  1264.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
  1265.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
  1266.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  1267.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  1268.  
  1269.     PORT_START      /* Analog joystick 1 */
  1270.     PORT_START
  1271.     PORT_START      /* Analog joystick 2 */
  1272.     PORT_START
  1273.     PORT_START      /* Analog joystick 3 */
  1274.     PORT_START
  1275. INPUT_PORTS_END
  1276.  
  1277.  
  1278. INPUT_PORTS_START( wseries )        /* complete, verified from code */
  1279.     PORT_START      /* 0x80 */
  1280.     PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
  1281.     PORT_BITX(0x40, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1, "Extra Base", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
  1282.     PORT_BITX(0x80, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1, "Go Back", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
  1283.  
  1284.     PORT_START      /* 0x81 */
  1285.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLAVEHALT )
  1286.     PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
  1287.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
  1288.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
  1289.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  1290.  
  1291.     PORT_START      /* 0x90 */
  1292.     PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED )
  1293.     PORT_BITX(0x80, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER1, "Aim", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
  1294.  
  1295.     PORT_START      /* 0x91 */
  1296.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_EEPROM_DATA )
  1297.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
  1298.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 | IPF_PLAYER1 )
  1299.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 | IPF_PLAYER1 )
  1300.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  1301.  
  1302.     PORT_START      /* Analog joystick 1 */
  1303.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_Y | IPF_PLAYER1, 100, 10, 0, 255 )
  1304.     PORT_START
  1305.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_X | IPF_PLAYER1, 100, 10, 0, 255 )
  1306.     PORT_START      /* Analog joystick 2 */
  1307.     PORT_START
  1308.     PORT_START      /* Analog joystick 3 */
  1309.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_X | IPF_PLAYER2, 100, 10, 0, 255 )
  1310.     PORT_START
  1311.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_Y | IPF_PLAYER2, 100, 10, 0, 255 )
  1312. INPUT_PORTS_END
  1313.  
  1314.  
  1315. INPUT_PORTS_START( alleymas )        /* complete, verified from code */
  1316.     PORT_START      /* 0xC0 */
  1317.     PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
  1318.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
  1319.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
  1320.  
  1321.     PORT_START      /* 0xC1 */
  1322.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLAVEHALT )
  1323.     PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
  1324.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
  1325.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
  1326.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  1327.  
  1328.     PORT_START      /* 0xD0 */
  1329.     PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
  1330.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 )        /* redundant inputs */
  1331.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 )        /* redundant inputs */
  1332.  
  1333.     PORT_START      /* 0xD1 */
  1334.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_EEPROM_DATA )
  1335.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
  1336.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 | IPF_PLAYER1 )
  1337.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 | IPF_PLAYER1 )
  1338.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  1339.  
  1340.     PORT_START      /* Analog joystick 1 */
  1341.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_Y | IPF_PLAYER1, 100, 10, 0, 255 )
  1342.     PORT_START
  1343.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_X | IPF_PLAYER1, 100, 10, 0, 224 )
  1344.     PORT_START      /* Analog joystick 2 */
  1345.     PORT_START
  1346.     PORT_START      /* Analog joystick 3 */
  1347.     PORT_START
  1348. INPUT_PORTS_END
  1349.  
  1350.  
  1351. INPUT_PORTS_START( dangerz )        /* complete, verified from code */
  1352.     PORT_START      /* 0x80 */
  1353.     PORT_BIT( 0x1f, IP_ACTIVE_LOW, IPT_UNUSED )
  1354.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
  1355.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
  1356.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
  1357.  
  1358.     PORT_START      /* 0x81 */
  1359.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLAVEHALT )
  1360.     PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
  1361.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
  1362.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
  1363.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  1364.  
  1365.     PORT_START      /* 0x90 */
  1366.     PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
  1367.  
  1368.     PORT_START      /* 0x91 */
  1369.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_EEPROM_DATA )
  1370.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
  1371.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
  1372.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  1373.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  1374.  
  1375.     PORT_START      /* Analog 1 */
  1376.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_Y | IPF_PLAYER1, 100, 10, 0, 255 )
  1377.     PORT_START      /* Analog 2 */
  1378.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_X | IPF_PLAYER1, 100, 10, 0, 255 )
  1379. INPUT_PORTS_END
  1380.  
  1381.  
  1382. INPUT_PORTS_START( basebal2 )        /* complete, verified from code */
  1383.     PORT_START      /* 0x40/C0 */
  1384.     PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
  1385.     PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* read by strkzone, but never referenced */
  1386.     PORT_BITX(0x40, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1, "Extra Base", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
  1387.     PORT_BITX(0x80, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1, "Go Back", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
  1388.  
  1389.     PORT_START      /* 0x41/C1 */
  1390.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLAVEHALT )
  1391.     PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
  1392.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
  1393.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
  1394.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  1395.  
  1396.     PORT_START      /* 0x50/D0 */
  1397.     PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
  1398.     PORT_BITX(0x10, IP_ACTIVE_LOW, IPT_BUTTON4 | IPF_PLAYER1, "R Run/Steal", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
  1399.     PORT_BITX(0x20, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER1, "L Run/Steal", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
  1400.     PORT_BITX(0x40, IP_ACTIVE_LOW, IPT_BUTTON6 | IPF_PLAYER1, "Run/Aim", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
  1401.     PORT_BITX(0x80, IP_ACTIVE_LOW, IPT_BUTTON5 | IPF_PLAYER1, "Run/Cutoff", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
  1402.  
  1403.     PORT_START      /* 0x51/D1 */
  1404.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_EEPROM_DATA )
  1405.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
  1406.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 | IPF_PLAYER1 )
  1407.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 | IPF_PLAYER1 )
  1408.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  1409.  
  1410.     PORT_START      /* Analog joystick 1 */
  1411.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_Y | IPF_PLAYER1, 100, 10, 0, 255 )
  1412.     PORT_START
  1413.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_X | IPF_PLAYER1, 100, 10, 0, 255 )
  1414.     PORT_START      /* Analog joystick 2 */
  1415.     PORT_START
  1416.     PORT_START      /* Analog joystick 3 */
  1417.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_X | IPF_PLAYER2, 100, 10, 0, 255 )
  1418.     PORT_START
  1419.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_Y | IPF_PLAYER2, 100, 10, 0, 255 )
  1420. INPUT_PORTS_END
  1421.  
  1422.  
  1423. INPUT_PORTS_START( redline )        /* complete, verified in code */
  1424.     PORT_START      /* 0xC0 */
  1425.     PORT_BIT( 0x1f, IP_ACTIVE_LOW, IPT_UNUSED )
  1426.     PORT_ANALOG( 0xe0, 0xe0, IPT_PEDAL | IPF_PLAYER1, 100, 64, 0x00, 0xff )
  1427.  
  1428.     PORT_START      /* 0xC1 */
  1429.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLAVEHALT )
  1430.     PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
  1431.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
  1432.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
  1433.     PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNUSED )
  1434.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* used, but for what purpose? */
  1435.  
  1436.     PORT_START      /* 0xD0 */
  1437.     PORT_BIT( 0x1f, IP_ACTIVE_LOW, IPT_UNUSED )
  1438.     PORT_ANALOG( 0xe0, 0xe0, IPT_PEDAL | IPF_PLAYER2, 100, 64, 0x00, 0xff )
  1439.  
  1440.     PORT_START      /* 0xD1 */
  1441.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_EEPROM_DATA )
  1442.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
  1443.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
  1444.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  1445.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  1446.  
  1447.     PORT_START      /* Analog wheel 1 */
  1448.     PORT_ANALOG( 0xff, 0x80, IPT_DIAL | IPF_PLAYER1, 100, 10, 0, 255 )
  1449.     PORT_START      /* Analog wheel 2 */
  1450.     PORT_ANALOG( 0xff, 0x80, IPT_DIAL | IPF_PLAYER2, 100, 10, 0, 255 )
  1451. INPUT_PORTS_END
  1452.  
  1453.  
  1454. INPUT_PORTS_START( quarterb )        /* complete, verified in code */
  1455.     PORT_START      /* 0x80 */
  1456.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  1457.     PORT_BIT( 0x0e, IP_ACTIVE_LOW, IPT_UNUSED )
  1458.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  1459.     PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
  1460.  
  1461.     PORT_START      /* 0x81 */
  1462.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLAVEHALT )
  1463.     PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
  1464.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
  1465.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
  1466.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  1467.  
  1468.     PORT_START      /* 0x90 */
  1469.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_PLAYER2 )
  1470.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_PLAYER2 )
  1471.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_PLAYER2 )
  1472.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_PLAYER2 )
  1473.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_PLAYER1 )
  1474.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_PLAYER1 )
  1475.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_PLAYER1 )
  1476.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_PLAYER1 )
  1477.  
  1478.     PORT_START      /* 0x91 */
  1479.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_EEPROM_DATA )
  1480.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
  1481.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
  1482.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  1483.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  1484.  
  1485.     PORT_START      /* Analog spring stick 1 */
  1486.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_X | IPF_PLAYER1, 100, 10, 0, 255 )
  1487.     PORT_START      /* Analog spring stick 2 */
  1488.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_Y | IPF_PLAYER1, 100, 10, 0, 255 )
  1489.     PORT_START      /* Analog spring stick 3 */
  1490.     PORT_START      /* Analog spring stick 4 */
  1491.     PORT_START      /* Analog spring stick 5 */
  1492.     PORT_START      /* Analog spring stick 6 */
  1493. INPUT_PORTS_END
  1494.  
  1495.  
  1496. INPUT_PORTS_START( teamqb )        /* complete, verified in code */
  1497.     PORT_START      /* 0x80 */
  1498.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  1499.     PORT_BIT( 0x0e, IP_ACTIVE_LOW, IPT_UNUSED )
  1500.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  1501.     PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
  1502.  
  1503.     PORT_START      /* 0x81 */
  1504.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLAVEHALT )
  1505.     PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
  1506.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
  1507.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
  1508.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  1509.  
  1510.     PORT_START      /* 0x90 */
  1511.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_PLAYER2 )
  1512.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_PLAYER2 )
  1513.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_PLAYER2 )
  1514.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_PLAYER2 )
  1515.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_PLAYER1 )
  1516.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_PLAYER1 )
  1517.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_PLAYER1 )
  1518.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_PLAYER1 )
  1519.  
  1520.     PORT_START      /* 0x91 */
  1521.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_EEPROM_DATA )
  1522.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
  1523.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
  1524.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  1525.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  1526.  
  1527.     PORT_START      /* Analog spring stick 1 */
  1528.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_X | IPF_PLAYER1, 100, 10, 0, 255 )
  1529.     PORT_START      /* Analog spring stick 2 */
  1530.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_Y | IPF_PLAYER1, 100, 10, 0, 255 )
  1531.     PORT_START      /* Analog spring stick 3 */
  1532.     PORT_START      /* Analog spring stick 4 */
  1533.     PORT_START      /* Analog spring stick 5 */
  1534.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_Y | IPF_PLAYER3, 100, 10, 0, 255 )
  1535.     PORT_START      /* Analog spring stick 6 */
  1536.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_X | IPF_PLAYER3, 100, 10, 0, 255 )
  1537.  
  1538.     PORT_START      /* 0x7C */
  1539.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER4 )
  1540.     PORT_BIT( 0x0e, IP_ACTIVE_LOW, IPT_UNUSED )
  1541.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER3 )
  1542.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
  1543.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START3 )
  1544.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 )
  1545.  
  1546.     PORT_START      /* 0x7F */
  1547.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_PLAYER4 )
  1548.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_PLAYER4 )
  1549.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_PLAYER4 )
  1550.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_PLAYER4 )
  1551.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_PLAYER3 )
  1552.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_PLAYER3 )
  1553.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_PLAYER3 )
  1554.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_PLAYER3 )
  1555. INPUT_PORTS_END
  1556.  
  1557.  
  1558. INPUT_PORTS_START( aafb2p )        /* complete, verified in code */
  1559.     PORT_START      /* 0x80 */
  1560.     PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
  1561.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  1562.     PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
  1563.  
  1564.     PORT_START      /* 0x81 */
  1565.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLAVEHALT )
  1566.     PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
  1567.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
  1568.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
  1569.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  1570.  
  1571.     PORT_START      /* 0x90 */
  1572.     PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
  1573.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_PLAYER1 )
  1574.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_PLAYER1 )
  1575.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_PLAYER1 )
  1576.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_PLAYER1 )
  1577.  
  1578.     PORT_START      /* 0x91 */
  1579.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_EEPROM_DATA )
  1580.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
  1581.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
  1582.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  1583.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  1584.  
  1585.     PORT_START      /* Analog spring stick 1 */
  1586.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_X | IPF_PLAYER1, 100, 10, 0, 255 )
  1587.     PORT_START      /* Analog spring stick 2 */
  1588.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_Y | IPF_PLAYER1, 100, 10, 0, 255 )
  1589.     PORT_START      /* Analog spring stick 3 */
  1590.     PORT_START      /* Analog spring stick 4 */
  1591.     PORT_START      /* Analog spring stick 5 */
  1592.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_Y | IPF_PLAYER2, 100, 10, 0, 255 )
  1593.     PORT_START      /* Analog spring stick 6 */
  1594.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_X | IPF_PLAYER2, 100, 10, 0, 255 )
  1595.  
  1596.     PORT_START      /* 0x7C */
  1597.     PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
  1598.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  1599.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
  1600.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  1601.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
  1602.  
  1603.     PORT_START      /* 0x7F */
  1604.     PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
  1605.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_PLAYER2 )
  1606.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_PLAYER2 )
  1607.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_PLAYER2 )
  1608.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_PLAYER2 )
  1609. INPUT_PORTS_END
  1610.  
  1611.  
  1612. INPUT_PORTS_START( offroad )        /* complete, verified from code */
  1613.     PORT_START      /* 0xC0 */
  1614.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* read */
  1615.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* read */
  1616.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* read */
  1617.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
  1618.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  1619.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  1620.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER3 )
  1621.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
  1622.  
  1623.     PORT_START      /* 0xC1 */
  1624.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLAVEHALT )
  1625.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 )
  1626.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
  1627.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
  1628.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  1629.  
  1630.     PORT_START      /* 0xD0 */
  1631.     PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
  1632.  
  1633.     PORT_START      /* 0xD1 */
  1634.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_EEPROM_DATA )
  1635.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
  1636.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
  1637.     PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
  1638.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  1639.  
  1640.     PORT_START      /* Analog pedal 1 */
  1641.     PORT_ANALOG( 0xff, 0x00, IPT_PEDAL | IPF_PLAYER1, 100, 10, 0, 255 )
  1642.     PORT_START      /* Analog pedal 2 */
  1643.     PORT_ANALOG( 0xff, 0x00, IPT_PEDAL | IPF_PLAYER2, 100, 10, 0, 255 )
  1644.     PORT_START      /* Analog pedal 3 */
  1645.     PORT_ANALOG( 0xff, 0x00, IPT_PEDAL | IPF_PLAYER3, 100, 10, 0, 255 )
  1646.     PORT_START      /* Analog wheel 1 */
  1647.     PORT_ANALOG( 0xff, 0x80, IPT_DIAL | IPF_PLAYER1, 100, 10, 0, 255 )
  1648.     PORT_START      /* Analog wheel 2 */
  1649.     PORT_ANALOG( 0xff, 0x80, IPT_DIAL | IPF_PLAYER2, 100, 10, 0, 255 )
  1650.     PORT_START      /* Analog wheel 3 */
  1651.     PORT_ANALOG( 0xff, 0x80, IPT_DIAL | IPF_PLAYER3, 100, 10, 0, 255 )
  1652. INPUT_PORTS_END
  1653.  
  1654.  
  1655. INPUT_PORTS_START( pigout )        /* complete, verified from code */
  1656.     PORT_START      /* 0x40 */
  1657.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
  1658.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER3 )
  1659.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER3 )
  1660.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER3 )
  1661.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
  1662.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  1663.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_PLAYER2 )
  1664.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP   | IPF_8WAY | IPF_PLAYER2 )
  1665.  
  1666.     PORT_START      /* 0x41 */
  1667.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLAVEHALT )
  1668.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 )
  1669.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* read, but never referenced */
  1670.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
  1671.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  1672.  
  1673.     PORT_START      /* 0x50 */
  1674.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START3 )
  1675.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER3 )
  1676.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_PLAYER3 )
  1677.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP   | IPF_8WAY | IPF_PLAYER3 )
  1678.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
  1679.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  1680.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  1681.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  1682.  
  1683.     PORT_START      /* 0x51 */
  1684.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_EEPROM_DATA )
  1685.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
  1686.     PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
  1687.     PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED )
  1688.  
  1689.     PORT_START      /* 0x7F */
  1690.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
  1691.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
  1692.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  1693.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  1694.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  1695.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  1696.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
  1697.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  1698. INPUT_PORTS_END
  1699.  
  1700.  
  1701.  
  1702. /*************************************
  1703.  *
  1704.  *    Graphics definitions
  1705.  *
  1706.  *************************************/
  1707.  
  1708. static struct GfxLayout bklayout =
  1709. {
  1710.     8,8,
  1711.     RGN_FRAC(1,3),
  1712.     3,
  1713.     { RGN_FRAC(0,3), RGN_FRAC(1,3), RGN_FRAC(2,3) },
  1714.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  1715.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  1716.     8*8
  1717. };
  1718.  
  1719. static struct GfxDecodeInfo gfxdecodeinfo[] =
  1720. {
  1721.     { REGION_GFX1, 0, &bklayout, 0, 8 },
  1722.     { -1 } /* end of array */
  1723. };
  1724.  
  1725.  
  1726.  
  1727. /*************************************
  1728.  *
  1729.  *    Sound definitions
  1730.  *
  1731.  *************************************/
  1732.  
  1733. /*
  1734.    2 AY8910 chips - Actually, one of these is an 8912
  1735.    (8910 with only 1 output port)
  1736.  
  1737.    Port A of both chips is connected to a banking control
  1738.    register.
  1739. */
  1740.  
  1741. static struct AY8910interface ay8910_interface =
  1742. {
  1743.     2,
  1744.     10000000/6, /* 1.666 MHz */
  1745.     { 25, 25 },
  1746.     { sound_port_r, sound_port_r },
  1747.     { 0 },
  1748.     { sound_port_w, sound_port_w },
  1749.     { 0 }
  1750. };
  1751.  
  1752. static struct CustomSound_interface dac_custom_interface =
  1753. {
  1754.     leland_sh_start,
  1755.     leland_sh_stop
  1756. };
  1757.  
  1758. static struct CustomSound_interface i186_custom_interface =
  1759. {
  1760.     leland_i186_sh_start
  1761. };
  1762.  
  1763. static struct CustomSound_interface redline_custom_interface =
  1764. {
  1765.       redline_i186_sh_start
  1766. };
  1767.  
  1768.  
  1769.  
  1770. /*************************************
  1771.  *
  1772.  *    Machine driver
  1773.  *
  1774.  *************************************/
  1775.  
  1776. static struct MachineDriver machine_driver_leland =
  1777. {
  1778.     /* basic machine hardware */
  1779.     {
  1780.         {
  1781.             CPU_Z80,
  1782.             6000000,
  1783.             master_readmem,master_writemem,
  1784.             master_readport,master_writeport,
  1785.             master_interrupt,1
  1786.         },
  1787.         {
  1788.             CPU_Z80,
  1789.             6000000,
  1790.             slave_small_readmem,slave_small_writemem,
  1791.             slave_readport,slave_writeport,
  1792.             ignore_interrupt,1
  1793.         }
  1794.     },
  1795.     60, (1000000*16)/(256*60),
  1796.     1,
  1797.     init_machine,
  1798.  
  1799.     /* video hardware */
  1800.     40*8, 30*8, { 0*8, 40*8-1, 0*8, 30*8-1 },
  1801.     gfxdecodeinfo,
  1802.     1024,1024,
  1803.     0,
  1804.  
  1805.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  1806.     leland_vh_eof,
  1807.     leland_vh_start,
  1808.     leland_vh_stop,
  1809.     leland_vh_screenrefresh,
  1810.  
  1811.     /* sound hardware */
  1812.     0,0,0,0,
  1813.     {
  1814.         { SOUND_AY8910, &ay8910_interface },
  1815.         { SOUND_CUSTOM, &dac_custom_interface }
  1816.     },
  1817.     nvram_handler
  1818. };
  1819.  
  1820.  
  1821. static struct MachineDriver machine_driver_redline =
  1822. {
  1823.     /* basic machine hardware */
  1824.     {
  1825.         {
  1826.             CPU_Z80,
  1827.             6000000,
  1828.             master_readmem,master_writemem,
  1829.             master_readport,master_writeport,
  1830.             master_interrupt,1
  1831.         },
  1832.         {
  1833.             CPU_Z80,
  1834.             6000000,
  1835.             slave_small_readmem,slave_small_writemem,
  1836.             slave_readport,slave_writeport,
  1837.             ignore_interrupt,1
  1838.         },
  1839.         {
  1840.             CPU_I186 | CPU_AUDIO_CPU,
  1841.             16000000/2,
  1842.             leland_i86_readmem,leland_i86_writemem,
  1843.             leland_i86_readport,redline_i86_writeport,
  1844.             ignore_interrupt,1
  1845.         }
  1846.     },
  1847.     60, (1000000*16)/(256*60),
  1848.     1,
  1849.     init_machine,
  1850.  
  1851.     /* video hardware */
  1852.     40*8, 30*8, { 0*8, 40*8-1, 0*8, 30*8-1 },
  1853.     gfxdecodeinfo,
  1854.     1024,1024,
  1855.     0,
  1856.  
  1857.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  1858.     leland_vh_eof,
  1859.     leland_vh_start,
  1860.     leland_vh_stop,
  1861.     leland_vh_screenrefresh,
  1862.  
  1863.     /* sound hardware */
  1864.     0,0,0,0,
  1865.     {
  1866.         { SOUND_AY8910, &ay8910_interface },
  1867.         { SOUND_CUSTOM, &redline_custom_interface }
  1868.     },
  1869.     nvram_handler
  1870. };
  1871.  
  1872.  
  1873. static struct MachineDriver machine_driver_quarterb =
  1874. {
  1875.     /* basic machine hardware */
  1876.     {
  1877.         {
  1878.             CPU_Z80,
  1879.             6000000,
  1880.             master_readmem,master_writemem,
  1881.             master_readport,master_writeport,
  1882.             master_interrupt,1
  1883.         },
  1884.         {
  1885.             CPU_Z80,
  1886.             6000000,
  1887.             slave_small_readmem,slave_small_writemem,
  1888.             slave_readport,slave_writeport,
  1889.             ignore_interrupt,1
  1890.         },
  1891.         {
  1892.             CPU_I186 | CPU_AUDIO_CPU,
  1893.             16000000/2,
  1894.             leland_i86_readmem,leland_i86_writemem,
  1895.             leland_i86_readport,leland_i86_writeport,
  1896.             ignore_interrupt,1
  1897.         }
  1898.     },
  1899.     60, (1000000*16)/(256*60),
  1900.     1,
  1901.     init_machine,
  1902.  
  1903.     /* video hardware */
  1904.     40*8, 30*8, { 0*8, 40*8-1, 0*8, 30*8-1 },
  1905.     gfxdecodeinfo,
  1906.     1024,1024,
  1907.     0,
  1908.  
  1909.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  1910.     leland_vh_eof,
  1911.     leland_vh_start,
  1912.     leland_vh_stop,
  1913.     leland_vh_screenrefresh,
  1914.  
  1915.     /* sound hardware */
  1916.     0,0,0,0,
  1917.     {
  1918.         { SOUND_AY8910, &ay8910_interface },
  1919.         { SOUND_CUSTOM, &i186_custom_interface }
  1920.     },
  1921.     nvram_handler
  1922. };
  1923.  
  1924.  
  1925. static struct MachineDriver machine_driver_lelandi =
  1926. {
  1927.     /* basic machine hardware */
  1928.     {
  1929.         {
  1930.             CPU_Z80,
  1931.             6000000,
  1932.             master_readmem,master_writemem,
  1933.             master_readport,master_writeport,
  1934.             master_interrupt,1
  1935.         },
  1936.         {
  1937.             CPU_Z80,
  1938.             6000000,
  1939.             slave_large_readmem,slave_large_writemem,
  1940.             slave_readport,slave_writeport,
  1941.             ignore_interrupt,1
  1942.         },
  1943.         {
  1944.             CPU_I186 | CPU_AUDIO_CPU,
  1945.             16000000/2,
  1946.             leland_i86_readmem,leland_i86_writemem,
  1947.             leland_i86_readport,leland_i86_writeport,
  1948.             ignore_interrupt,1
  1949.         }
  1950.     },
  1951.     60, (1000000*16)/(256*60),
  1952.     1,
  1953.     init_machine,
  1954.  
  1955.     /* video hardware */
  1956.     40*8, 30*8, { 0*8, 40*8-1, 0*8, 30*8-1 },
  1957.     gfxdecodeinfo,
  1958.     1024,1024,
  1959.     0,
  1960.  
  1961.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  1962.     leland_vh_eof,
  1963.     leland_vh_start,
  1964.     leland_vh_stop,
  1965.     leland_vh_screenrefresh,
  1966.  
  1967.     /* sound hardware */
  1968.     0,0,0,0,
  1969.     {
  1970.         { SOUND_AY8910, &ay8910_interface },
  1971.         { SOUND_CUSTOM, &i186_custom_interface }
  1972.     },
  1973.     nvram_handler
  1974. };
  1975.  
  1976.  
  1977.  
  1978. /*************************************
  1979.  *
  1980.  *    ROM definitions
  1981.  *
  1982.  *************************************/
  1983.  
  1984. ROM_START( cerberus )
  1985.     ROM_REGION( 0x10000, REGION_CPU1 )
  1986.     ROM_LOAD( "3-23u101", 0x00000, 0x02000, 0xd78210df )
  1987.     ROM_LOAD( "3-23u102", 0x02000, 0x02000, 0xeed121ef )
  1988.     ROM_LOAD( "3-23u103", 0x04000, 0x02000, 0x45b82bf7 )
  1989.     ROM_LOAD( "3-23u104", 0x06000, 0x02000, 0xe133d6bf )
  1990.     ROM_LOAD( "3-23u105", 0x08000, 0x02000, 0xa12c2c79 )
  1991.     ROM_LOAD( "3-23u106", 0x0a000, 0x02000, 0xd64110d2 )
  1992.     ROM_LOAD( "3-23u107", 0x0c000, 0x02000, 0x24e41c34 )
  1993.  
  1994.     ROM_REGION( 0x10000, REGION_CPU2 )
  1995.     ROM_LOAD( "3-23u3",  0x00000, 0x02000, 0xb0579138 )
  1996.     ROM_LOAD( "3-23u4",  0x02000, 0x02000, 0xba0dc990 )
  1997.     ROM_LOAD( "3-23u5",  0x04000, 0x02000, 0xf8d6cc5d )
  1998.     ROM_LOAD( "3-23u6",  0x06000, 0x02000, 0x42cdd393 )
  1999.     ROM_LOAD( "3-23u7",  0x08000, 0x02000, 0xc020148a )
  2000.     ROM_LOAD( "3-23u8",  0x0a000, 0x02000, 0xdbabdbde )
  2001.     ROM_LOAD( "3-23u9",  0x0c000, 0x02000, 0xeb992385 )
  2002.  
  2003.     ROM_REGION( 0x06000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2004.     ROM_LOAD( "3-23u93", 0x00000, 0x02000, 0x14a1a4b0 )
  2005.     ROM_LOAD( "3-23u94", 0x02000, 0x02000, 0x207a1709 )
  2006.     ROM_LOAD( "3-23u95", 0x04000, 0x02000, 0xe9c86267 )
  2007.  
  2008.     ROM_REGION( 0x20000, REGION_USER1 )   /* Ordering: 70/92/69/91/68/90/67/89 */
  2009.     ROM_LOAD( "3-23u70",  0x02000, 0x2000, 0x96499983 )
  2010.     ROM_LOAD( "3-23_u92", 0x06000, 0x2000, 0x497bb717 )
  2011.     ROM_LOAD( "3-23u69",  0x0a000, 0x2000, 0xebd14d9e )
  2012.     ROM_LOAD( "3-23u91",  0x0e000, 0x2000, 0xb592d2e5 )
  2013.     ROM_LOAD( "3-23u68",  0x12000, 0x2000, 0xcfa7b8bf )
  2014.     ROM_LOAD( "3-23u90",  0x16000, 0x2000, 0xb7566f8a )
  2015.     ROM_LOAD( "3-23u67",  0x1a000, 0x2000, 0x02b079a8 )
  2016.     ROM_LOAD( "3-23u89",  0x1e000, 0x2000, 0x7e5e82bb )
  2017.  
  2018.     ROM_REGION( battery_ram_size, REGION_USER2 ) /* extra RAM regions */
  2019. ROM_END
  2020.  
  2021. ROM_START( mayhem )
  2022.     ROM_REGION( 0x28000, REGION_CPU1 )
  2023.     ROM_LOAD( "13208.101",   0x00000, 0x04000, 0x04306973 )
  2024.     ROM_LOAD( "13215.102",   0x10000, 0x02000, 0x06e689ae )
  2025.     ROM_CONTINUE(            0x1c000, 0x02000 )
  2026.     ROM_LOAD( "13216.103",   0x12000, 0x02000, 0x6452a82c )
  2027.     ROM_CONTINUE(            0x1e000, 0x02000 )
  2028.     ROM_LOAD( "13217.104",   0x14000, 0x02000, 0x62f6036e )
  2029.     ROM_CONTINUE(            0x20000, 0x02000 )
  2030.     ROM_LOAD( "13218.105",   0x16000, 0x02000, 0x162f5eb1 )
  2031.     ROM_CONTINUE(            0x22000, 0x02000 )
  2032.     ROM_LOAD( "13219.106",   0x18000, 0x02000, 0xc0a74d6f )
  2033.     ROM_CONTINUE(            0x24000, 0x02000 )
  2034.  
  2035.     ROM_REGION( 0x28000, REGION_CPU2 )
  2036.     ROM_LOAD( "13207.3",  0x00000, 0x04000, 0xbe1df6aa ) /* DO NOT TRIM THIS ROM */
  2037.     ROM_LOAD( "13209.4",  0x10000, 0x02000, 0x39fcd7c6 )
  2038.     ROM_CONTINUE(         0x1c000, 0x02000 )
  2039.     ROM_LOAD( "13210.5",  0x12000, 0x02000, 0x630ed136 )
  2040.     ROM_CONTINUE(         0x1e000, 0x02000 )
  2041.     ROM_LOAD( "13211.6",  0x14000, 0x02000, 0x28b4aecd )
  2042.     ROM_CONTINUE(         0x20000, 0x02000 )
  2043.     ROM_LOAD( "13212.7",  0x16000, 0x02000, 0x1d6b39ab )
  2044.     ROM_CONTINUE(         0x22000, 0x02000 )
  2045.     ROM_LOAD( "13213.8",  0x18000, 0x02000, 0xf3b2ea05 )
  2046.     ROM_CONTINUE(         0x24000, 0x02000 )
  2047.     ROM_LOAD( "13214.9",  0x1a000, 0x02000, 0x96f3e8d9 )
  2048.     ROM_CONTINUE(         0x26000, 0x02000 )
  2049.  
  2050.     ROM_REGION( 0x0c000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2051.     ROM_LOAD( "13204.93", 0x00000, 0x04000, 0xde183518 )
  2052.     ROM_LOAD( "13205.94", 0x04000, 0x04000, 0xc61f63ac )
  2053.     ROM_LOAD( "13206.95", 0x08000, 0x04000, 0x8e7bd2fd )
  2054.  
  2055.     ROM_REGION( 0x20000, REGION_USER1 )   /* Ordering: 70/92/69/91/68/90/67/89 */
  2056.     /* U70 = Empty */
  2057.     ROM_LOAD( "13203.92",  0x04000, 0x4000, 0x121ed5bf )
  2058.     ROM_LOAD( "13201.69",  0x08000, 0x4000, 0x90283e29 )
  2059.     /* U91 = Empty */
  2060.     /* U68 = Empty */
  2061.     /* U90 = Empty */
  2062.     /* U67 = Empty */
  2063.     ROM_LOAD( "13202.89",  0x1c000, 0x4000, 0xc5eaa4e3 )
  2064.  
  2065.     ROM_REGION( battery_ram_size, REGION_USER2 ) /* extra RAM regions */
  2066. ROM_END
  2067.  
  2068. ROM_START( wseries )
  2069.     ROM_REGION( 0x28000, REGION_CPU1 )
  2070.     ROM_LOAD( "13409-01.101",   0x00000, 0x02000, 0xb5eccf5c )
  2071.     ROM_LOAD( "13410-01.102",   0x10000, 0x02000, 0xdd1ec091 )
  2072.     ROM_CONTINUE(               0x1c000, 0x02000 )
  2073.     ROM_LOAD( "13411-01.103",   0x12000, 0x02000, 0xec867a0e )
  2074.     ROM_CONTINUE(               0x1e000, 0x02000 )
  2075.     ROM_LOAD( "13412-01.104",   0x14000, 0x02000, 0x2977956d )
  2076.     ROM_CONTINUE(               0x20000, 0x02000 )
  2077.     ROM_LOAD( "13413-01.105",   0x16000, 0x02000, 0x569468a6 )
  2078.     ROM_CONTINUE(               0x22000, 0x02000 )
  2079.     ROM_LOAD( "13414-01.106",   0x18000, 0x02000, 0xb178632d )
  2080.     ROM_CONTINUE(               0x24000, 0x02000 )
  2081.     ROM_LOAD( "13415-01.107",   0x1a000, 0x02000, 0x20b92eff )
  2082.     ROM_CONTINUE(               0x26000, 0x02000 )
  2083.  
  2084.     ROM_REGION( 0x28000, REGION_CPU2 )
  2085.     ROM_LOAD( "13416-00.u3",  0x00000, 0x02000, 0x37c960cf )
  2086.     ROM_LOAD( "13417-00.u4",  0x10000, 0x02000, 0x97f044b5 )
  2087.     ROM_CONTINUE(             0x1c000, 0x02000 )
  2088.     ROM_LOAD( "13418-00.u5",  0x12000, 0x02000, 0x0931cfc0 )
  2089.     ROM_CONTINUE(             0x1e000, 0x02000 )
  2090.     ROM_LOAD( "13419-00.u6",  0x14000, 0x02000, 0xa7962b5a )
  2091.     ROM_CONTINUE(             0x20000, 0x02000 )
  2092.     ROM_LOAD( "13420-00.u7",  0x16000, 0x02000, 0x3c275262 )
  2093.     ROM_CONTINUE(             0x22000, 0x02000 )
  2094.     ROM_LOAD( "13421-00.u8",  0x18000, 0x02000, 0x86f57c80 )
  2095.     ROM_CONTINUE(             0x24000, 0x02000 )
  2096.     ROM_LOAD( "13422-00.u9",  0x1a000, 0x02000, 0x222e8405 )
  2097.     ROM_CONTINUE(             0x26000, 0x02000 )
  2098.  
  2099.     ROM_REGION( 0x0c000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2100.     ROM_LOAD( "13401-00.u93", 0x00000, 0x04000, 0x4ea3e641 )
  2101.     ROM_LOAD( "13402-00.u94", 0x04000, 0x04000, 0x71a8a56c )
  2102.     ROM_LOAD( "13403-00.u95", 0x08000, 0x04000, 0x8077ae25 )
  2103.  
  2104.     ROM_REGION( 0x20000, REGION_USER1 )   /* Ordering: 70/92/69/91/68/90/67/89 */
  2105.     /* U70 = Empty */
  2106.     ROM_LOAD( "13404-00.u92",  0x04000, 0x4000, 0x22da40aa )
  2107.     ROM_LOAD( "13405-00.u69",  0x08000, 0x4000, 0x6f65b313 )
  2108.     /* U91 = Empty */
  2109.     ROM_LOAD( "13406-00.u68",  0x12000, 0x2000, 0xbb568693 )
  2110.     ROM_LOAD( "13407-00.u90",  0x14000, 0x4000, 0xe46ca57f )
  2111.     ROM_LOAD( "13408-00.u67",  0x18000, 0x4000, 0xbe637305 )
  2112.     /* 89 = Empty */
  2113.  
  2114.     ROM_REGION( battery_ram_size, REGION_USER2 ) /* extra RAM regions */
  2115. ROM_END
  2116.  
  2117. ROM_START( alleymas )
  2118.     ROM_REGION( 0x28000, REGION_CPU1 )
  2119.     ROM_LOAD( "101",   0x00000, 0x02000, 0x4273e260 )
  2120.     ROM_LOAD( "102",   0x10000, 0x02000, 0xeb6575aa )
  2121.     ROM_CONTINUE(      0x1c000, 0x02000 )
  2122.     ROM_LOAD( "103",   0x12000, 0x02000, 0xcc9d778c )
  2123.     ROM_CONTINUE(      0x1e000, 0x02000 )
  2124.     ROM_LOAD( "104",   0x14000, 0x02000, 0x8edb129b )
  2125.     ROM_CONTINUE(      0x20000, 0x02000 )
  2126.     ROM_LOAD( "105",   0x16000, 0x02000, 0xa342dc8e )
  2127.     ROM_CONTINUE(      0x22000, 0x02000 )
  2128.     ROM_LOAD( "106",   0x18000, 0x02000, 0xb396c254 )
  2129.     ROM_CONTINUE(      0x24000, 0x02000 )
  2130.     ROM_LOAD( "107",   0x1a000, 0x02000, 0x3ca13e8c )
  2131.     ROM_CONTINUE(      0x26000, 0x02000 )
  2132.  
  2133.     ROM_REGION( 0x28000, REGION_CPU2 )
  2134.     ROM_LOAD( "003",  0x00000, 0x02000, 0x3fee63ae )
  2135.     ROM_LOAD( "004",  0x10000, 0x02000, 0xd302b5d1 )
  2136.     ROM_CONTINUE(     0x1c000, 0x02000 )
  2137.     ROM_LOAD( "005",  0x12000, 0x02000, 0x79bdb24d )
  2138.     ROM_CONTINUE(     0x1e000, 0x02000 )
  2139.     ROM_LOAD( "006",  0x14000, 0x02000, 0xf0b15d68 )
  2140.     ROM_CONTINUE(     0x20000, 0x02000 )
  2141.     ROM_LOAD( "007",  0x16000, 0x02000, 0x6974036c )
  2142.     ROM_CONTINUE(     0x22000, 0x02000 )
  2143.     ROM_LOAD( "008",  0x18000, 0x02000, 0xa4357b5a )
  2144.     ROM_CONTINUE(     0x24000, 0x02000 )
  2145.     ROM_LOAD( "009",  0x1a000, 0x02000, 0x6d74274e )
  2146.     ROM_CONTINUE(     0x26000, 0x02000 )
  2147.  
  2148.     ROM_REGION( 0x06000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2149.     ROM_LOAD( "093", 0x00000, 0x02000, 0x54456e6f )
  2150.     ROM_LOAD( "094", 0x02000, 0x02000, 0xedc240da )
  2151.     ROM_LOAD( "095", 0x04000, 0x02000, 0x19793ed0 )
  2152.  
  2153.     ROM_REGION( 0x20000, REGION_USER1 )   /* Ordering: 70/92/69/91/68/90/67/89 */
  2154.     /* U70 = Empty */
  2155.     ROM_LOAD( "092",  0x04000, 0x2000, 0xa020eab5 )
  2156.     ROM_LOAD( "069",  0x08000, 0x2000, 0x79abb979 )
  2157.     /* U91 = Empty */
  2158.     ROM_LOAD( "068",  0x10000, 0x2000, 0x0c583385 )
  2159.     ROM_LOAD( "090",  0x14000, 0x2000, 0x0e1769e3 )
  2160.     /* U67 = Empty */
  2161.     /* U89 = Empty */
  2162.  
  2163.     ROM_REGION( battery_ram_size, REGION_USER2 ) /* extra RAM regions */
  2164. ROM_END
  2165.  
  2166. ROM_START( dangerz )
  2167.     ROM_REGION( 0x20000, REGION_CPU1 )
  2168.     ROM_LOAD( "13823.12t",   0x00000, 0x10000, 0x31604634 )
  2169.     ROM_LOAD( "13824.13t",   0x10000, 0x10000, 0x381026c6 )
  2170.  
  2171.     ROM_REGION( 0x28000, REGION_CPU2 )
  2172.     ROM_LOAD( "13818.3",   0x00000, 0x04000, 0x71863c5b )
  2173.     ROM_LOAD( "13817.4",   0x10000, 0x02000, 0x924bead3 )
  2174.     ROM_CONTINUE(          0x1c000, 0x02000 )
  2175.     ROM_LOAD( "13818.5",   0x12000, 0x02000, 0x403bdfea )
  2176.     ROM_CONTINUE(          0x1e000, 0x02000 )
  2177.     ROM_LOAD( "13819.6",   0x14000, 0x02000, 0x1fee5f10 )
  2178.     ROM_CONTINUE(          0x20000, 0x02000 )
  2179.     ROM_LOAD( "13820.7",   0x16000, 0x02000, 0x42657a1e )
  2180.     ROM_CONTINUE(          0x22000, 0x02000 )
  2181.     ROM_LOAD( "13821.8",   0x18000, 0x02000, 0x92f3e006 )
  2182.     ROM_CONTINUE(          0x24000, 0x02000 )
  2183.  
  2184.     ROM_REGION( 0x0c000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2185.     ROM_LOAD( "13801.93", 0x00000, 0x04000, 0xf9ff55ec )
  2186.     ROM_LOAD( "13802.94", 0x04000, 0x04000, 0xd4adbcbb )
  2187.     ROM_LOAD( "13803.95", 0x08000, 0x04000, 0x9178ed76 )
  2188.  
  2189.     ROM_REGION( 0x20000, REGION_USER1 )   /* Ordering: 70/92/69/91/68/90/67/89 */
  2190.     ROM_LOAD( "13809.70",  0x00000, 0x4000, 0xe44eb9f5 )
  2191.     ROM_LOAD( "13804.92",  0x04000, 0x4000, 0x6c23f1a5 )
  2192.     ROM_LOAD( "13805.69",  0x08000, 0x4000, 0xe9c9f38b )
  2193.     ROM_LOAD( "13808.91",  0x0c000, 0x4000, 0x035534ad )
  2194.     ROM_LOAD( "13806.68",  0x10000, 0x4000, 0x2dbd64d2 )
  2195.     ROM_LOAD( "13808.90",  0x14000, 0x4000, 0xd5b4985d )
  2196.     ROM_LOAD( "13822.67",  0x18000, 0x4000, 0x00ff3033 )
  2197.     ROM_LOAD( "13810.89",  0x1c000, 0x4000, 0x4f645973 )
  2198.  
  2199.     ROM_REGION( battery_ram_size, REGION_USER2 ) /* extra RAM regions */
  2200. ROM_END
  2201.  
  2202. ROM_START( basebal2 )
  2203.     ROM_REGION( 0x38000, REGION_CPU1 )
  2204.     ROM_LOAD( "14115-00.101",   0x00000, 0x02000, 0x05231fee )
  2205.     ROM_LOAD( "14116-00.102",   0x10000, 0x02000, 0xe1482ea3 )
  2206.     ROM_CONTINUE(               0x1c000, 0x02000 )
  2207.     ROM_LOAD( "14117-01.103",   0x12000, 0x02000, 0x677181dd )
  2208.     ROM_CONTINUE(               0x1e000, 0x02000 )
  2209.     ROM_LOAD( "14118-01.104",   0x14000, 0x02000, 0x5f570264 )
  2210.     ROM_CONTINUE(               0x20000, 0x02000 )
  2211.     ROM_LOAD( "14119-01.105",   0x16000, 0x02000, 0x90822145 )
  2212.     ROM_CONTINUE(               0x22000, 0x02000 )
  2213.     ROM_LOAD( "14120-00.106",   0x18000, 0x02000, 0x4d2b7217 )
  2214.     ROM_CONTINUE(               0x24000, 0x02000 )
  2215.     ROM_LOAD( "14121-01.107",   0x1a000, 0x02000, 0xb987b97c )
  2216.     ROM_CONTINUE(               0x26000, 0x02000 )
  2217.     /* Extra banks ( referred to as the "top" board). Probably an add-on */
  2218.     ROM_LOAD( "14122-01.u2t",   0x28000, 0x02000, 0xa89882d8 )
  2219.     ROM_RELOAD(                 0x30000, 0x02000 )
  2220.     ROM_LOAD( "14123-01.u3t",   0x2a000, 0x02000, 0xf9c51e5a )
  2221.     ROM_RELOAD(                 0x32000, 0x02000 )
  2222.  
  2223.     ROM_REGION( 0x28000, REGION_CPU2 )
  2224.     ROM_LOAD( "14100-01.u3",  0x00000, 0x02000, 0x1dffbdaf )
  2225.     ROM_LOAD( "14101-01.u4",  0x10000, 0x02000, 0xc585529c )
  2226.     ROM_CONTINUE(             0x1c000, 0x02000 )
  2227.     ROM_LOAD( "14102-01.u5",  0x12000, 0x02000, 0xace3f918 )
  2228.     ROM_CONTINUE(             0x1e000, 0x02000 )
  2229.     ROM_LOAD( "14103-01.u6",  0x14000, 0x02000, 0xcd41cf7a )
  2230.     ROM_CONTINUE(             0x20000, 0x02000 )
  2231.     ROM_LOAD( "14104-01.u7",  0x16000, 0x02000, 0x9b169e78 )
  2232.     ROM_CONTINUE(             0x22000, 0x02000 )
  2233.     ROM_LOAD( "14105-01.u8",  0x18000, 0x02000, 0xec596b43 )
  2234.     ROM_CONTINUE(             0x24000, 0x02000 )
  2235.     ROM_LOAD( "14106-01.u9",  0x1a000, 0x02000, 0xb9656baa )
  2236.     ROM_CONTINUE(             0x26000, 0x02000 )
  2237.  
  2238.     ROM_REGION( 0x0c000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2239.     ROM_LOAD( "14112-00.u93", 0x00000, 0x04000, 0x8ccb1404 )
  2240.     ROM_LOAD( "14113-00.u94", 0x04000, 0x04000, 0x9941a55b )
  2241.     ROM_LOAD( "14114-00.u95", 0x08000, 0x04000, 0xb68baf47 )
  2242.  
  2243.     ROM_REGION( 0x20000, REGION_USER1 )   /* Ordering: 70/92/69/91/68/90/67/89 */
  2244.     /* U70 = Empty */
  2245.     ROM_LOAD( "14111-01.u92",  0x04000, 0x4000, 0x2508a9ad )
  2246.     ROM_LOAD( "14109-00.u69",  0x08000, 0x4000, 0xb123a28e )
  2247.     /* U91 = Empty */
  2248.     ROM_LOAD( "14108-01.u68",  0x10000, 0x4000, 0xa1a51383 )
  2249.     ROM_LOAD( "14110-01.u90",  0x14000, 0x4000, 0xef01d997 )
  2250.     ROM_LOAD( "14107-00.u67",  0x18000, 0x4000, 0x976334e6 )
  2251.     /* 89 = Empty */
  2252.  
  2253.     ROM_REGION( battery_ram_size, REGION_USER2 ) /* extra RAM regions */
  2254. ROM_END
  2255.  
  2256. ROM_START( dblplay )
  2257.     ROM_REGION( 0x38000, REGION_CPU1 )
  2258.     ROM_LOAD( "15018-01.101",   0x00000, 0x02000, 0x17b6af29 )
  2259.     ROM_LOAD( "15019-01.102",   0x10000, 0x02000, 0x9fc8205e )
  2260.     ROM_CONTINUE(               0x1c000, 0x02000 )
  2261.     ROM_LOAD( "15020-01.103",   0x12000, 0x02000, 0x4edcc091 )
  2262.     ROM_CONTINUE(               0x1e000, 0x02000 )
  2263.     ROM_LOAD( "15021-01.104",   0x14000, 0x02000, 0xa0eba1c7 )
  2264.     ROM_CONTINUE(               0x20000, 0x02000 )
  2265.     ROM_LOAD( "15022-01.105",   0x16000, 0x02000, 0x7bbfe0b7 )
  2266.     ROM_CONTINUE(               0x22000, 0x02000 )
  2267.     ROM_LOAD( "15023-01.106",   0x18000, 0x02000, 0xbbedae34 )
  2268.     ROM_CONTINUE(               0x24000, 0x02000 )
  2269.     ROM_LOAD( "15024-01.107",   0x1a000, 0x02000, 0x02afcf52 )
  2270.     ROM_CONTINUE(               0x26000, 0x02000 )
  2271.     /* Extra banks ( referred to as the "top" board). Probably an add-on */
  2272.     ROM_LOAD( "15025-01.u2t",   0x28000, 0x02000, 0x1c959895 )
  2273.     ROM_RELOAD(                 0x30000, 0x02000 )
  2274.     ROM_LOAD( "15026-01.u3t",   0x2a000, 0x02000, 0xed5196d6 )
  2275.     ROM_RELOAD(                 0x32000, 0x02000 )
  2276.     ROM_LOAD( "15027-01.u4t",   0x2c000, 0x02000, 0x9b1e72e9 )
  2277.     ROM_CONTINUE(               0x34000, 0x02000 )
  2278.  
  2279.     ROM_REGION( 0x28000, REGION_CPU2 )
  2280.     ROM_LOAD( "15000-01.u03",  0x00000, 0x02000, 0x208a920a )
  2281.     ROM_LOAD( "15001-01.u04",  0x10000, 0x02000, 0x751c40d6 )
  2282.     ROM_CONTINUE(              0x1c000, 0x02000 )
  2283.     ROM_LOAD( "14402-01.u05",  0x12000, 0x02000, 0x5ffaec36 )
  2284.     ROM_CONTINUE(              0x1e000, 0x02000 )
  2285.     ROM_LOAD( "14403-01.u06",  0x14000, 0x02000, 0x48d6d9d3 )
  2286.     ROM_CONTINUE(              0x20000, 0x02000 )
  2287.     ROM_LOAD( "15004-01.u07",  0x16000, 0x02000, 0x6a7acebc )
  2288.     ROM_CONTINUE(              0x22000, 0x02000 )
  2289.     ROM_LOAD( "15005-01.u08",  0x18000, 0x02000, 0x69d487c9 )
  2290.     ROM_CONTINUE(              0x24000, 0x02000 )
  2291.     ROM_LOAD( "15006-01.u09",  0x1a000, 0x02000, 0xab3aac49 )
  2292.     ROM_CONTINUE(              0x26000, 0x02000 )
  2293.  
  2294.     ROM_REGION( 0x0c000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2295.     ROM_LOAD( "15015-01.u93", 0x00000, 0x04000, 0x8ccb1404 )
  2296.     ROM_LOAD( "15016-01.u94", 0x04000, 0x04000, 0x9941a55b )
  2297.     ROM_LOAD( "15017-01.u95", 0x08000, 0x04000, 0xb68baf47 )
  2298.  
  2299.     ROM_REGION( 0x20000, REGION_USER1 )   /* Ordering: 70/92/69/91/68/90/67/89 */
  2300.     /* U70 = Empty */
  2301.     ROM_LOAD( "15014-01.u92",  0x04000, 0x4000, 0x2508a9ad )
  2302.     ROM_LOAD( "15009-01.u69",  0x08000, 0x4000, 0xb123a28e )
  2303.     /* U91 = Empty */
  2304.     ROM_LOAD( "15008-01.u68",  0x10000, 0x4000, 0xa1a51383 )
  2305.     ROM_LOAD( "15012-01.u90",  0x14000, 0x4000, 0xef01d997 )
  2306.     ROM_LOAD( "15007-01.u67",  0x18000, 0x4000, 0x976334e6 )
  2307.     /* 89 = Empty */
  2308.  
  2309.     ROM_REGION( battery_ram_size, REGION_USER2 ) /* extra RAM regions */
  2310. ROM_END
  2311.  
  2312. ROM_START( strkzone )
  2313.     ROM_REGION( 0x38000, REGION_CPU1 )
  2314.     ROM_LOAD( "strkzone.101",   0x00000, 0x04000, 0x8d83a611 )
  2315.     ROM_LOAD( "strkzone.102",   0x10000, 0x02000, 0x3859e67d )
  2316.     ROM_CONTINUE(               0x1c000, 0x02000 )
  2317.     ROM_LOAD( "strkzone.103",   0x12000, 0x02000, 0xcdd83bfb )
  2318.     ROM_CONTINUE(               0x1e000, 0x02000 )
  2319.     ROM_LOAD( "strkzone.104",   0x14000, 0x02000, 0xbe280212 )
  2320.     ROM_CONTINUE(               0x20000, 0x02000 )
  2321.     ROM_LOAD( "strkzone.105",   0x16000, 0x02000, 0xafb63390 )
  2322.     ROM_CONTINUE(               0x22000, 0x02000 )
  2323.     ROM_LOAD( "strkzone.106",   0x18000, 0x02000, 0xe853b9f6 )
  2324.     ROM_CONTINUE(               0x24000, 0x02000 )
  2325.     ROM_LOAD( "strkzone.107",   0x1a000, 0x02000, 0x1b4b6c2d )
  2326.     ROM_CONTINUE(               0x26000, 0x02000 )
  2327.     /* Extra banks ( referred to as the "top" board). Probably an add-on */
  2328.     ROM_LOAD( "strkzone.u2t",   0x28000, 0x02000, 0x8e0af06f )
  2329.     ROM_RELOAD(                 0x30000, 0x02000 )
  2330.     ROM_LOAD( "strkzone.u3t",   0x2a000, 0x02000, 0x909d35f3 )
  2331.     ROM_RELOAD(                 0x32000, 0x02000 )
  2332.     ROM_LOAD( "strkzone.u4t",   0x2c000, 0x02000, 0x9b1e72e9 )
  2333.     ROM_CONTINUE(               0x34000, 0x02000 )
  2334.  
  2335.     ROM_REGION( 0x28000, REGION_CPU2 )
  2336.     ROM_LOAD( "strkzone.u3",  0x00000, 0x02000, 0x40258fbe )
  2337.     ROM_LOAD( "strkzone.u4",  0x10000, 0x02000, 0xdf7f2604 )
  2338.     ROM_CONTINUE(             0x1c000, 0x02000 )
  2339.     ROM_LOAD( "strkzone.u5",  0x12000, 0x02000, 0x37885206 )
  2340.     ROM_CONTINUE(             0x1e000, 0x02000 )
  2341.     ROM_LOAD( "strkzone.u6",  0x14000, 0x02000, 0x6892dc4f )
  2342.     ROM_CONTINUE(             0x20000, 0x02000 )
  2343.     ROM_LOAD( "strkzone.u7",  0x16000, 0x02000, 0x6ac8f87c )
  2344.     ROM_CONTINUE(             0x22000, 0x02000 )
  2345.     ROM_LOAD( "strkzone.u8",  0x18000, 0x02000, 0x4b6d3725 )
  2346.     ROM_CONTINUE(             0x24000, 0x02000 )
  2347.     ROM_LOAD( "strkzone.u9",  0x1a000, 0x02000, 0xab3aac49 )
  2348.     ROM_CONTINUE(             0x26000, 0x02000 )
  2349.  
  2350.     ROM_REGION( 0x0c000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2351.     ROM_LOAD( "strkzone.u93", 0x00000, 0x04000, 0x8ccb1404 )
  2352.     ROM_LOAD( "strkzone.u94", 0x04000, 0x04000, 0x9941a55b )
  2353.     ROM_LOAD( "strkzone.u95", 0x08000, 0x04000, 0xb68baf47 )
  2354.  
  2355.     ROM_REGION( 0x20000, REGION_USER1 )   /* Ordering: 70/92/69/91/68/90/67/89 */
  2356.     /* U70 = Empty */
  2357.     ROM_LOAD( "strkzone.u92",  0x04000, 0x4000, 0x2508a9ad )
  2358.     ROM_LOAD( "strkzone.u69",  0x08000, 0x4000, 0xb123a28e )
  2359.     /* U91 = Empty */
  2360.     ROM_LOAD( "strkzone.u68",  0x10000, 0x4000, 0xa1a51383 )
  2361.     ROM_LOAD( "strkzone.u90",  0x14000, 0x4000, 0xef01d997 )
  2362.     ROM_LOAD( "strkzone.u67",  0x18000, 0x4000, 0x976334e6 )
  2363.     /* 89 = Empty */
  2364.  
  2365.     ROM_REGION( battery_ram_size, REGION_USER2 ) /* extra RAM regions */
  2366. ROM_END
  2367.  
  2368. ROM_START( redlin2p )
  2369.     ROM_REGION( 0x20000, REGION_CPU1 )
  2370.     ROM_LOAD( "13932-01.23t", 0x00000, 0x10000, 0xecdf0fbe )
  2371.     ROM_LOAD( "13931-01.22t", 0x10000, 0x10000, 0x16d01978 )
  2372.  
  2373.     ROM_REGION( 0x80000, REGION_CPU2 )
  2374.     ROM_LOAD( "13907-01.u3",  0x00000, 0x04000, 0xb760d63e )
  2375.     ROM_LOAD( "13908-01.u4",  0x10000, 0x02000, 0xa30739d3 )
  2376.     ROM_CONTINUE(             0x1c000, 0x02000 )
  2377.     ROM_LOAD( "13909-01.u5",  0x12000, 0x02000, 0xaaf16ad7 )
  2378.     ROM_CONTINUE(             0x1e000, 0x02000 )
  2379.     ROM_LOAD( "13910-01.u6",  0x14000, 0x02000, 0xd03469eb )
  2380.     ROM_CONTINUE(             0x20000, 0x02000 )
  2381.     ROM_LOAD( "13911-01.u7",  0x16000, 0x02000, 0x8ee1f547 )
  2382.     ROM_CONTINUE(             0x22000, 0x02000 )
  2383.     ROM_LOAD( "13912-01.u8",  0x18000, 0x02000, 0xe5b57eac )
  2384.     ROM_CONTINUE(             0x24000, 0x02000 )
  2385.     ROM_LOAD( "13913-01.u9",  0x1a000, 0x02000, 0x02886071 )
  2386.     ROM_CONTINUE(             0x26000, 0x02000 )
  2387.  
  2388.     ROM_REGION( 0x100000, REGION_CPU3 )
  2389.     ROM_LOAD_V20_EVEN( "17t",    0x0e0000, 0x10000, 0x8d26f221 )
  2390.     ROM_LOAD_V20_ODD ( "28t",    0x0e0000, 0x10000, 0x7aa21b2c )
  2391.  
  2392.     ROM_REGION( 0x0c000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2393.     ROM_LOAD( "13930-01.u93", 0x00000, 0x04000, 0x0721f42e )
  2394.     ROM_LOAD( "13929-01.u94", 0x04000, 0x04000, 0x1522e7b2 )
  2395.     ROM_LOAD( "13928-01.u95", 0x08000, 0x04000, 0xc321b5d1 )
  2396.  
  2397.     ROM_REGION( 0x20000, REGION_USER1 )   /* Ordering: 70/92/69/91/68/90/67/89 */
  2398.     ROM_LOAD( "13920-01.u70",  0x00000, 0x4000, 0xf343d34a )
  2399.     ROM_LOAD( "13921-01.u92",  0x04000, 0x4000, 0xc9ba8d41 )
  2400.     ROM_LOAD( "13922-01.u69",  0x08000, 0x4000, 0x276cfba0 )
  2401.     ROM_LOAD( "13923-01.u91",  0x0c000, 0x4000, 0x4a88ea34 )
  2402.     ROM_LOAD( "13924-01.u68",  0x10000, 0x4000, 0x3995cb7e )
  2403.     /* 90 = empty / missing */
  2404.     ROM_LOAD( "13926-01.u67",  0x18000, 0x4000, 0xdaa30add )
  2405.     ROM_LOAD( "13927-01.u89",  0x1c000, 0x4000, 0x30e60fb5 )
  2406.  
  2407.     ROM_REGION( battery_ram_size, REGION_USER2 ) /* extra RAM regions */
  2408. ROM_END
  2409.  
  2410. ROM_START( quarterb )
  2411.     ROM_REGION( 0x20000, REGION_CPU1 )
  2412.     ROM_LOAD( "15219-05.49t", 0x00000, 0x10000, 0xff653e4f )
  2413.     ROM_LOAD( "15218-05.48t", 0x10000, 0x10000, 0x34b83d81 )
  2414.  
  2415.     ROM_REGION( 0x80000, REGION_CPU2 )
  2416.     ROM_LOAD( "15200-01.u3",  0x00000, 0x04000, 0x83297861 )
  2417.     ROM_LOAD( "15201-01.u4",  0x10000, 0x02000, 0xaf8dbdab )
  2418.     ROM_CONTINUE(             0x1c000, 0x02000 )
  2419.     ROM_LOAD( "15202-01.u5",  0x12000, 0x02000, 0x3eeecb3d )
  2420.     ROM_CONTINUE(             0x1e000, 0x02000 )
  2421.     ROM_LOAD( "15203-01.u6",  0x14000, 0x02000, 0xb9c5b663 )
  2422.     ROM_CONTINUE(             0x20000, 0x02000 )
  2423.     ROM_LOAD( "15204-01.u7",  0x16000, 0x02000, 0xc68821b7 )
  2424.     ROM_CONTINUE(             0x22000, 0x02000 )
  2425.     ROM_LOAD( "15205-01.u8",  0x18000, 0x02000, 0x2be843a9 )
  2426.     ROM_CONTINUE(             0x24000, 0x02000 )
  2427.     ROM_LOAD( "15206-01.u9",  0x1a000, 0x02000, 0x6bf8d4ab )
  2428.     ROM_CONTINUE(             0x26000, 0x02000 )
  2429.  
  2430.     ROM_REGION( 0x100000, REGION_CPU3 )
  2431.     ROM_LOAD_V20_EVEN( "15222-02.45t", 0x040000, 0x10000, 0x710bdc76 )
  2432.     ROM_LOAD_V20_ODD ( "15225-02.62t", 0x040000, 0x10000, 0x041cecde )
  2433.     ROM_LOAD_V20_EVEN( "15221-02.44t", 0x060000, 0x10000, 0xe0459ddb )
  2434.     ROM_LOAD_V20_ODD ( "15224-02.61t", 0x060000, 0x10000, 0x9027c579 )
  2435.     ROM_LOAD_V20_EVEN( "15220-02.43t", 0x0e0000, 0x10000, 0x48a8a018 )
  2436.     ROM_LOAD_V20_ODD ( "15223-02.60t", 0x0e0000, 0x10000, 0x6a299766 )
  2437.  
  2438.     ROM_REGION( 0x0c000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2439.     ROM_LOAD( "15215-01.u93", 0x00000, 0x04000, 0x4fb678d7 )
  2440.     ROM_LOAD( "lelqb.94",     0x04000, 0x04000, 0x7b57a44c )
  2441.     ROM_LOAD( "lelqb.95",     0x08000, 0x04000, 0x29bc33fd )
  2442.  
  2443.     ROM_REGION( 0x20000, REGION_USER1 )   /* Ordering: 70/92/69/91/68/90/67/89 */
  2444.     ROM_LOAD( "15210-01.u70",  0x00000, 0x4000, 0xa5aea20e )
  2445.     ROM_LOAD( "15214-01.u92",  0x04000, 0x4000, 0x36f261ca )
  2446.     ROM_LOAD( "15209-01.u69",  0x08000, 0x4000, 0x0f5d74a4 )
  2447.     /* 91 = empty */
  2448.     ROM_LOAD( "15208-01.u68",  0x10000, 0x4000, 0x0319aec7 )
  2449.     ROM_LOAD( "15212-01.u90",  0x14000, 0x4000, 0x38b298d6 )
  2450.     ROM_LOAD( "15207-01.u67",  0x18000, 0x4000, 0x5ff86aad )
  2451.     /* 89 = empty */
  2452.  
  2453.     ROM_REGION( battery_ram_size, REGION_USER2 ) /* extra RAM regions */
  2454. ROM_END
  2455.  
  2456. ROM_START( quartrba )
  2457.     ROM_REGION( 0x20000, REGION_CPU1 )
  2458.     ROM_LOAD( "15219-02.49t",   0x00000, 0x10000, 0x7fbe1e5a )
  2459.     ROM_LOAD( "15218-02.48t",   0x10000, 0x10000, 0x6fbd4b27 )
  2460.  
  2461.     ROM_REGION( 0x80000, REGION_CPU2 )
  2462.     ROM_LOAD( "15200-01.u3",  0x00000, 0x04000, 0x83297861 )
  2463.     ROM_LOAD( "15201-01.u4",  0x10000, 0x02000, 0xaf8dbdab )
  2464.     ROM_CONTINUE(             0x1c000, 0x02000 )
  2465.     ROM_LOAD( "15202-01.u5",  0x12000, 0x02000, 0x3eeecb3d )
  2466.     ROM_CONTINUE(             0x1e000, 0x02000 )
  2467.     ROM_LOAD( "15203-01.u6",  0x14000, 0x02000, 0xb9c5b663 )
  2468.     ROM_CONTINUE(             0x20000, 0x02000 )
  2469.     ROM_LOAD( "15204-01.u7",  0x16000, 0x02000, 0xc68821b7 )
  2470.     ROM_CONTINUE(             0x22000, 0x02000 )
  2471.     ROM_LOAD( "15205-01.u8",  0x18000, 0x02000, 0x2be843a9 )
  2472.     ROM_CONTINUE(             0x24000, 0x02000 )
  2473.     ROM_LOAD( "15206-01.u9",  0x1a000, 0x02000, 0x6bf8d4ab )
  2474.     ROM_CONTINUE(             0x26000, 0x02000 )
  2475.  
  2476.     ROM_REGION( 0x100000, REGION_CPU3 )
  2477.     ROM_LOAD_V20_EVEN( "15222-01.45t", 0x040000, 0x10000, 0x722d1a19 )
  2478.     ROM_LOAD_V20_ODD ( "15225-01.62t", 0x040000, 0x10000, 0xf8c20496 )
  2479.     ROM_LOAD_V20_EVEN( "15221-01.44t", 0x060000, 0x10000, 0xbc6abaaf )
  2480.     ROM_LOAD_V20_ODD ( "15224-01.61t", 0x060000, 0x10000, 0x7ce3c3b7 )
  2481.     ROM_LOAD_V20_EVEN( "15220-01.43t", 0x0e0000, 0x10000, 0xccb6c8d7 )
  2482.     ROM_LOAD_V20_ODD ( "15223-01.60t", 0x0e0000, 0x10000, 0xc0ee425d )
  2483.  
  2484.     ROM_REGION( 0x0c000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2485.     ROM_LOAD( "15215-01.u93", 0x00000, 0x04000, 0x4fb678d7 )
  2486.     ROM_LOAD( "lelqb.94",     0x04000, 0x04000, 0x7b57a44c )
  2487.     ROM_LOAD( "lelqb.95",     0x08000, 0x04000, 0x29bc33fd )
  2488.  
  2489.     ROM_REGION( 0x20000, REGION_USER1 )   /* Ordering: 70/92/69/91/68/90/67/89 */
  2490.     ROM_LOAD( "15210-01.u70",  0x00000, 0x4000, 0xa5aea20e )
  2491.     ROM_LOAD( "15214-01.u92",  0x04000, 0x4000, 0x36f261ca )
  2492.     ROM_LOAD( "15209-01.u69",  0x08000, 0x4000, 0x0f5d74a4 )
  2493.     /* 91 = empty */
  2494.     ROM_LOAD( "15208-01.u68",  0x10000, 0x4000, 0x0319aec7 )
  2495.     ROM_LOAD( "15212-01.u90",  0x14000, 0x4000, 0x38b298d6 )
  2496.     ROM_LOAD( "15207-01.u67",  0x18000, 0x4000, 0x5ff86aad )
  2497.     /* 89 = empty */
  2498.  
  2499.     ROM_REGION( battery_ram_size, REGION_USER2 ) /* extra RAM regions */
  2500. ROM_END
  2501.  
  2502. ROM_START( viper )
  2503.     ROM_REGION( 0x20000, REGION_CPU1 )
  2504.     ROM_LOAD( "15617-03.49t",   0x00000, 0x10000, 0x7e4688a6 )
  2505.     ROM_LOAD( "15616-03.48t",   0x10000, 0x10000, 0x3fe2f0bf )
  2506.  
  2507.     ROM_REGION( 0x80000, REGION_CPU2 )
  2508.     ROM_LOAD( "15600-02.u3", 0x00000, 0x02000, 0x0f57f68a )
  2509.     ROM_LOAD( "viper.u2t",   0x10000, 0x10000, 0x4043d4ee )
  2510.     ROM_LOAD( "viper.u3t",   0x20000, 0x10000, 0x213bc02b )
  2511.     ROM_LOAD( "viper.u4t",   0x30000, 0x10000, 0xce0b95b4 )
  2512.  
  2513.     ROM_REGION( 0x100000, REGION_CPU3 )
  2514.     ROM_LOAD_V20_EVEN( "15620-02.45t", 0x040000, 0x10000, 0x7380ece1 )
  2515.     ROM_LOAD_V20_ODD ( "15623-02.62t", 0x040000, 0x10000, 0x2921d8f9 )
  2516.     ROM_LOAD_V20_EVEN( "15619-02.44t", 0x060000, 0x10000, 0xc8507cc2 )
  2517.     ROM_LOAD_V20_ODD ( "15622-02.61t", 0x060000, 0x10000, 0x32dfda37 )
  2518.     ROM_LOAD_V20_EVEN( "15618-02.43t", 0x0e0000, 0x10000, 0x5562e0c3 )
  2519.     ROM_LOAD_V20_ODD ( "15621-02.60t", 0x0e0000, 0x10000, 0xcb468f2b )
  2520.  
  2521.     ROM_REGION( 0x0c000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2522.     ROM_LOAD( "15609-01.u93", 0x00000, 0x04000, 0x08ad92e9 )
  2523.     ROM_LOAD( "15610-01.u94", 0x04000, 0x04000, 0xd4e56dfb )
  2524.     ROM_LOAD( "15611-01.u95", 0x08000, 0x04000, 0x3a2c46fb )
  2525.  
  2526.     ROM_REGION( 0x20000, REGION_USER1 )   /* Ordering: 70/92/69/91/68/90/67/89 */
  2527.     ROM_LOAD( "15604-01.u70",  0x00000, 0x4000, 0x7e3b0cce )
  2528.     ROM_LOAD( "15608-01.u92",  0x04000, 0x4000, 0xa9bde0ef )
  2529.     ROM_LOAD( "15603-01.u69",  0x08000, 0x4000, 0xaecc9516 )
  2530.     ROM_LOAD( "15607-01.u91",  0x0c000, 0x4000, 0x14f06f88 )
  2531.     ROM_LOAD( "15602-01.u68",  0x10000, 0x4000, 0x4ef613ad )
  2532.     ROM_LOAD( "15606-01.u90",  0x14000, 0x4000, 0x3c2e8e76 )
  2533.     ROM_LOAD( "15601-01.u67",  0x18000, 0x4000, 0xdc7006cd )
  2534.     ROM_LOAD( "15605-01.u89",  0x1c000, 0x4000, 0x4aa9c788 )
  2535.  
  2536.     ROM_REGION( battery_ram_size, REGION_USER2 ) /* extra RAM regions */
  2537. ROM_END
  2538.  
  2539. ROM_START( teamqb )
  2540.     ROM_REGION( 0x20000, REGION_CPU1 )
  2541.     ROM_LOAD( "15618-03.58t",   0x00000, 0x10000, 0xb32568dc )
  2542.     ROM_LOAD( "15619-03.59t",   0x10000, 0x10000, 0x40b3319f )
  2543.  
  2544.     ROM_REGION( 0x80000, REGION_CPU2 )
  2545.     ROM_LOAD( "15600-01.u3",   0x00000, 0x02000, 0x46615844 )
  2546.     ROM_LOAD( "15601-01.u2t",  0x10000, 0x10000, 0x8e523c58 )
  2547.     ROM_LOAD( "15602-01.u3t",  0x20000, 0x10000, 0x545b27a1 )
  2548.     ROM_LOAD( "15603-01.u4t",  0x30000, 0x10000, 0xcdc9c09d )
  2549.     ROM_LOAD( "15604-01.u5t",  0x40000, 0x10000, 0x3c03e92e )
  2550.     ROM_LOAD( "15605-01.u6t",  0x50000, 0x10000, 0xcdf7d19c )
  2551.     ROM_LOAD( "15606-01.u7t",  0x60000, 0x10000, 0x8eeb007c )
  2552.     ROM_LOAD( "15607-01.u8t",  0x70000, 0x10000, 0x57cb6d2d )
  2553.  
  2554.     ROM_REGION( 0x100000, REGION_CPU3 )
  2555.     ROM_LOAD_V20_EVEN( "15623-01.25t", 0x040000, 0x10000, 0x710bdc76 )
  2556.     ROM_LOAD_V20_ODD ( "15620-01.13t", 0x040000, 0x10000, 0x7e5cb8ad )
  2557.     ROM_LOAD_V20_EVEN( "15624-01.26t", 0x060000, 0x10000, 0xdd090d33 )
  2558.     ROM_LOAD_V20_ODD ( "15621-01.14t", 0x060000, 0x10000, 0xf68c68c9 )
  2559.     ROM_LOAD_V20_EVEN( "15625-01.27t", 0x0e0000, 0x10000, 0xac442523 )
  2560.     ROM_LOAD_V20_ODD ( "15622-01.15t", 0x0e0000, 0x10000, 0x9e84509a )
  2561.  
  2562.     ROM_REGION( 0x0c000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2563.     ROM_LOAD( "15615-01.u93", 0x00000, 0x04000, 0xa7ea6a87 )
  2564.     ROM_LOAD( "15616-01.u94", 0x04000, 0x04000, 0x4a9b3900 )
  2565.     ROM_LOAD( "15617-01.u95", 0x08000, 0x04000, 0x2cd95edb )
  2566.  
  2567.     ROM_REGION( 0x20000, REGION_USER1 )   /* Ordering: 70/92/69/91/68/90/67/89 */
  2568.     ROM_LOAD( "15611-01.u70",  0x00000, 0x4000, 0xbf2695fb )
  2569.     ROM_LOAD( "15614-01.u92",  0x04000, 0x4000, 0xc93fd870 )
  2570.     ROM_LOAD( "15610-01.u69",  0x08000, 0x4000, 0x3e5b786f )
  2571.     /* 91 = empty */
  2572.     ROM_LOAD( "15609-01.u68",  0x10000, 0x4000, 0x0319aec7 )
  2573.     ROM_LOAD( "15613-01.u90",  0x14000, 0x4000, 0x4805802e )
  2574.     ROM_LOAD( "15608-01.u67",  0x18000, 0x4000, 0x78f0fd2b )
  2575.     /* 89 = empty */
  2576.  
  2577.     ROM_REGION( battery_ram_size, REGION_USER2 ) /* extra RAM regions */
  2578. ROM_END
  2579.  
  2580. ROM_START( teamqb2 )
  2581.     ROM_REGION( 0x20000, REGION_CPU1 )
  2582.     ROM_LOAD( "15618-03.58t",   0x00000, 0x10000, 0xb32568dc )
  2583.     ROM_LOAD( "15619-02.59t",   0x10000, 0x10000, 0x6d533714 )
  2584.  
  2585.     ROM_REGION( 0x80000, REGION_CPU2 )
  2586.     ROM_LOAD( "15600-01.u3",   0x00000, 0x02000, 0x46615844 )
  2587.     ROM_LOAD( "15601-01.u2t",  0x10000, 0x10000, 0x8e523c58 )
  2588.     ROM_LOAD( "15602-01.u3t",  0x20000, 0x10000, 0x545b27a1 )
  2589.     ROM_LOAD( "15603-01.u4t",  0x30000, 0x10000, 0xcdc9c09d )
  2590.     ROM_LOAD( "15604-01.u5t",  0x40000, 0x10000, 0x3c03e92e )
  2591.     ROM_LOAD( "15605-01.u6t",  0x50000, 0x10000, 0xcdf7d19c )
  2592.     ROM_LOAD( "15606-01.u7t",  0x60000, 0x10000, 0x8eeb007c )
  2593.     ROM_LOAD( "15607-01.u8t",  0x70000, 0x10000, 0x57cb6d2d )
  2594.  
  2595.     ROM_REGION( 0x100000, REGION_CPU3 )
  2596.     ROM_LOAD_V20_EVEN( "15623-01.25t", 0x040000, 0x10000, 0x710bdc76 )
  2597.     ROM_LOAD_V20_ODD ( "15620-01.13t", 0x040000, 0x10000, 0x7e5cb8ad )
  2598.     ROM_LOAD_V20_EVEN( "15624-01.26t", 0x060000, 0x10000, 0xdd090d33 )
  2599.     ROM_LOAD_V20_ODD ( "15621-01.14t", 0x060000, 0x10000, 0xf68c68c9 )
  2600.     ROM_LOAD_V20_EVEN( "15625-01.27t", 0x0e0000, 0x10000, 0xac442523 )
  2601.     ROM_LOAD_V20_ODD ( "15622-01.15t", 0x0e0000, 0x10000, 0x9e84509a )
  2602.  
  2603.     ROM_REGION( 0x0c000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2604.     ROM_LOAD( "15615-01.u93", 0x00000, 0x04000, 0xa7ea6a87 )
  2605.     ROM_LOAD( "15616-01.u94", 0x04000, 0x04000, 0x4a9b3900 )
  2606.     ROM_LOAD( "15617-01.u95", 0x08000, 0x04000, 0x2cd95edb )
  2607.  
  2608.     ROM_REGION( 0x20000, REGION_USER1 )   /* Ordering: 70/92/69/91/68/90/67/89 */
  2609.     ROM_LOAD( "15611-01.u70",  0x00000, 0x4000, 0xbf2695fb )
  2610.     ROM_LOAD( "15614-01.u92",  0x04000, 0x4000, 0xc93fd870 )
  2611.     ROM_LOAD( "15610-01.u69",  0x08000, 0x4000, 0x3e5b786f )
  2612.     /* 91 = empty */
  2613.     ROM_LOAD( "15609-01.u68",  0x10000, 0x4000, 0x0319aec7 )
  2614.     ROM_LOAD( "15613-01.u90",  0x14000, 0x4000, 0x4805802e )
  2615.     ROM_LOAD( "15608-01.u67",  0x18000, 0x4000, 0x78f0fd2b )
  2616.     /* 89 = empty */
  2617.  
  2618.     ROM_REGION( battery_ram_size, REGION_USER2 ) /* extra RAM regions */
  2619. ROM_END
  2620.  
  2621. ROM_START( aafb )
  2622.     ROM_REGION( 0x20000, REGION_CPU1 )
  2623.     ROM_LOAD( "aafbu58t.bin",   0x00000, 0x10000, 0xfa75a4a0 )
  2624.     ROM_LOAD( "aafbu59t.bin",   0x10000, 0x10000, 0xab6a606f )
  2625.  
  2626.     /* Everything from here down may be from the wrong version */
  2627.     ROM_REGION( 0x80000, REGION_CPU2 )
  2628.     ROM_LOAD( "24000-02.u3",   0x00000, 0x02000, 0x52df0354 )
  2629.     ROM_LOAD( "24001-02.u2t",  0x10000, 0x10000, 0x9b20697d )
  2630.     ROM_LOAD( "24002-02.u3t",  0x20000, 0x10000, 0xbbb92184 )
  2631.     ROM_LOAD( "15603-01.u4t",  0x30000, 0x10000, 0xcdc9c09d )
  2632.     ROM_LOAD( "15604-01.u5t",  0x40000, 0x10000, 0x3c03e92e )
  2633.     ROM_LOAD( "15605-01.u6t",  0x50000, 0x10000, 0xcdf7d19c )
  2634.     ROM_LOAD( "15606-01.u7t",  0x60000, 0x10000, 0x8eeb007c )
  2635.     ROM_LOAD( "24002-02.u8t",  0x70000, 0x10000, 0x3d9747c9 )
  2636.  
  2637.     ROM_REGION( 0x100000, REGION_CPU3 )
  2638.     ROM_LOAD_V20_EVEN( "24019-01.u25", 0x040000, 0x10000, 0x9e344768 )
  2639.     ROM_LOAD_V20_ODD ( "24016-01.u13", 0x040000, 0x10000, 0x6997025f )
  2640.     ROM_LOAD_V20_EVEN( "24020-01.u26", 0x060000, 0x10000, 0x0788f2a5 )
  2641.     ROM_LOAD_V20_ODD ( "24017-01.u14", 0x060000, 0x10000, 0xa48bd721 )
  2642.     ROM_LOAD_V20_EVEN( "24021-01.u27", 0x0e0000, 0x10000, 0x94081899 )
  2643.     ROM_LOAD_V20_ODD ( "24018-01.u15", 0x0e0000, 0x10000, 0x76eb6077 )
  2644.  
  2645.     ROM_REGION( 0x18000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2646.     ROM_LOAD( "24011-02.u93", 0x00000, 0x08000, 0x00000000 )
  2647.     ROM_LOAD( "24012-02.u94", 0x08000, 0x08000, 0x00000000 )
  2648.     ROM_LOAD( "24013-02.u95", 0x10000, 0x08000, 0x00000000 )
  2649.  
  2650.     ROM_REGION( 0x20000, REGION_USER1 )   /* Ordering: 70/92/69/91/68/90/67/89 */
  2651.     ROM_LOAD( "24007-01.u70",  0x00000, 0x4000, 0x40e46aa4 )
  2652.     ROM_LOAD( "24010-01.u92",  0x04000, 0x4000, 0x78705f42 )
  2653.     ROM_LOAD( "24006-01.u69",  0x08000, 0x4000, 0x6a576aa9 )
  2654.     ROM_LOAD( "24009-02.u91",  0x0c000, 0x4000, 0xb857a1ad )
  2655.     ROM_LOAD( "24005-02.u68",  0x10000, 0x4000, 0x8ea75319 )
  2656.     ROM_LOAD( "24008-01.u90",  0x14000, 0x4000, 0x4538bc58 )
  2657.     ROM_LOAD( "24004-02.u67",  0x18000, 0x4000, 0xcd7a3338 )
  2658.     /* 89 = empty */
  2659.  
  2660.     ROM_REGION( battery_ram_size, REGION_USER2 ) /* extra RAM regions */
  2661. ROM_END
  2662.  
  2663. ROM_START( aafbb )
  2664.     ROM_REGION( 0x20000, REGION_CPU1 )
  2665.     ROM_LOAD( "24014-02.u58",   0x00000, 0x10000, 0x5db4a3d0 )
  2666.     ROM_LOAD( "24015-02.u59",   0x10000, 0x10000, 0x00000000 )
  2667.  
  2668.     ROM_REGION( 0x80000, REGION_CPU2 )
  2669.     ROM_LOAD( "24000-02.u3",   0x00000, 0x02000, 0x52df0354 )
  2670.     ROM_LOAD( "24001-02.u2t",  0x10000, 0x10000, 0x9b20697d )
  2671.     ROM_LOAD( "24002-02.u3t",  0x20000, 0x10000, 0xbbb92184 )
  2672.     ROM_LOAD( "15603-01.u4t",  0x30000, 0x10000, 0xcdc9c09d )
  2673.     ROM_LOAD( "15604-01.u5t",  0x40000, 0x10000, 0x3c03e92e )
  2674.     ROM_LOAD( "15605-01.u6t",  0x50000, 0x10000, 0xcdf7d19c )
  2675.     ROM_LOAD( "15606-01.u7t",  0x60000, 0x10000, 0x8eeb007c )
  2676.     ROM_LOAD( "24002-02.u8t",  0x70000, 0x10000, 0x3d9747c9 )
  2677.  
  2678.     ROM_REGION( 0x100000, REGION_CPU3 )
  2679.     ROM_LOAD_V20_EVEN( "24019-01.u25", 0x040000, 0x10000, 0x9e344768 )
  2680.     ROM_LOAD_V20_ODD ( "24016-01.u13", 0x040000, 0x10000, 0x6997025f )
  2681.     ROM_LOAD_V20_EVEN( "24020-01.u26", 0x060000, 0x10000, 0x0788f2a5 )
  2682.     ROM_LOAD_V20_ODD ( "24017-01.u14", 0x060000, 0x10000, 0xa48bd721 )
  2683.     ROM_LOAD_V20_EVEN( "24021-01.u27", 0x0e0000, 0x10000, 0x94081899 )
  2684.     ROM_LOAD_V20_ODD ( "24018-01.u15", 0x0e0000, 0x10000, 0x76eb6077 )
  2685.  
  2686.     ROM_REGION( 0x18000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2687.     ROM_LOAD( "24011-02.u93", 0x00000, 0x08000, 0x71f4425b )
  2688.     ROM_LOAD( "24012-02.u94", 0x08000, 0x08000, 0xb2499547 )
  2689.     ROM_LOAD( "24013-02.u95", 0x10000, 0x08000, 0x0a604e0d )
  2690.  
  2691.     ROM_REGION( 0x20000, REGION_USER1 )   /* Ordering: 70/92/69/91/68/90/67/89 */
  2692.     ROM_LOAD( "24007-01.u70",  0x00000, 0x4000, 0x40e46aa4 )
  2693.     ROM_LOAD( "24010-01.u92",  0x04000, 0x4000, 0x78705f42 )
  2694.     ROM_LOAD( "24006-01.u69",  0x08000, 0x4000, 0x6a576aa9 )
  2695.     ROM_LOAD( "24009-02.u91",  0x0c000, 0x4000, 0xb857a1ad )
  2696.     ROM_LOAD( "24005-02.u68",  0x10000, 0x4000, 0x8ea75319 )
  2697.     ROM_LOAD( "24008-01.u90",  0x14000, 0x4000, 0x4538bc58 )
  2698.     ROM_LOAD( "24004-02.u67",  0x18000, 0x4000, 0xcd7a3338 )
  2699.     /* 89 = empty */
  2700.  
  2701.     ROM_REGION( battery_ram_size, REGION_USER2 ) /* extra RAM regions */
  2702. ROM_END
  2703.  
  2704. ROM_START( aafbd2p )
  2705.     ROM_REGION( 0x20000, REGION_CPU1 )
  2706.     ROM_LOAD( "26014-01.58t", 0x00000, 0x10000, 0x79fd14cd )
  2707.     ROM_LOAD( "26015-01.59t", 0x10000, 0x10000, 0x3b0382f0 )
  2708.  
  2709.     ROM_REGION( 0x80000, REGION_CPU2 )
  2710.     ROM_LOAD( "26000-01.u3",   0x00000, 0x02000, 0x98c06c63 )
  2711.     ROM_LOAD( "26001-01.2t",   0x10000, 0x10000, 0xf118b9b4 )
  2712.     ROM_LOAD( "24002-02.u3t",  0x20000, 0x10000, 0xbbb92184 )
  2713.     ROM_LOAD( "15603-01.u4t",  0x30000, 0x10000, 0xcdc9c09d )
  2714.     ROM_LOAD( "15604-01.u5t",  0x40000, 0x10000, 0x3c03e92e )
  2715.     ROM_LOAD( "15605-01.u6t",  0x50000, 0x10000, 0xcdf7d19c )
  2716.     ROM_LOAD( "15606-01.u7t",  0x60000, 0x10000, 0x8eeb007c )
  2717.     ROM_LOAD( "24002-02.u8t",  0x70000, 0x10000, 0x3d9747c9 )
  2718.  
  2719.     ROM_REGION( 0x100000, REGION_CPU3 )
  2720.     ROM_LOAD_V20_EVEN( "24019-01.u25", 0x040000, 0x10000, 0x9e344768 )
  2721.     ROM_LOAD_V20_ODD ( "24016-01.u13", 0x040000, 0x10000, 0x6997025f )
  2722.     ROM_LOAD_V20_EVEN( "24020-01.u26", 0x060000, 0x10000, 0x0788f2a5 )
  2723.     ROM_LOAD_V20_ODD ( "24017-01.u14", 0x060000, 0x10000, 0xa48bd721 )
  2724.     ROM_LOAD_V20_EVEN( "24021-01.u27", 0x0e0000, 0x10000, 0x94081899 )
  2725.     ROM_LOAD_V20_ODD ( "24018-01.u15", 0x0e0000, 0x10000, 0x76eb6077 )
  2726.  
  2727.     ROM_REGION( 0x18000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2728.     ROM_LOAD( "24011-02.u93", 0x00000, 0x08000, 0x71f4425b )
  2729.     ROM_LOAD( "24012-02.u94", 0x08000, 0x08000, 0xb2499547 )
  2730.     ROM_LOAD( "24013-02.u95", 0x10000, 0x08000, 0x0a604e0d )
  2731.  
  2732.     ROM_REGION( 0x20000, REGION_USER1 )   /* Ordering: 70/92/69/91/68/90/67/89 */
  2733.     ROM_LOAD( "24007-01.u70",  0x00000, 0x4000, 0x40e46aa4 )
  2734.     ROM_LOAD( "24010-01.u92",  0x04000, 0x4000, 0x78705f42 )
  2735.     ROM_LOAD( "24006-01.u69",  0x08000, 0x4000, 0x6a576aa9 )
  2736.     ROM_LOAD( "24009-02.u91",  0x0c000, 0x4000, 0xb857a1ad )
  2737.     ROM_LOAD( "24005-02.u68",  0x10000, 0x4000, 0x8ea75319 )
  2738.     ROM_LOAD( "24008-01.u90",  0x14000, 0x4000, 0x4538bc58 )
  2739.     ROM_LOAD( "24004-02.u67",  0x18000, 0x4000, 0xcd7a3338 )
  2740.     /* 89 = empty */
  2741.  
  2742.     ROM_REGION( battery_ram_size, REGION_USER2 ) /* extra RAM regions */
  2743. ROM_END
  2744.  
  2745. ROM_START( offroad )
  2746.     ROM_REGION( 0x40000, REGION_CPU1 )
  2747.     ROM_LOAD( "22121-04.u58",   0x00000, 0x10000, 0xc5790988 )
  2748.     ROM_LOAD( "22122-03.u59",   0x10000, 0x10000, 0xae862fdc )
  2749.     ROM_LOAD( "22120-01.u57",   0x20000, 0x10000, 0xe9f0f175 )
  2750.     ROM_LOAD( "22119-02.u56",   0x30000, 0x10000, 0x38642f22 )
  2751.  
  2752.     ROM_REGION( 0x80000, REGION_CPU2 )
  2753.     ROM_LOAD( "22100-01.u2",  0x00000, 0x02000, 0x08c96a4b )
  2754.     ROM_LOAD( "22108-02.u4",  0x30000, 0x10000, 0x0d72780a )
  2755.     ROM_LOAD( "22109-02.u5",  0x40000, 0x10000, 0x5429ce2c )
  2756.     ROM_LOAD( "22110-02.u6",  0x50000, 0x10000, 0xf97bad5c )
  2757.     ROM_LOAD( "22111-01.u7",  0x60000, 0x10000, 0xf79157a1 )
  2758.     ROM_LOAD( "22112-01.u8",  0x70000, 0x10000, 0x3eef38d3 )
  2759.  
  2760.     ROM_REGION( 0x100000, REGION_CPU3 )
  2761.     ROM_LOAD_V20_EVEN( "22116-03.u25", 0x040000, 0x10000, 0x95bb31d3 )
  2762.     ROM_LOAD_V20_ODD ( "22113-03.u13", 0x040000, 0x10000, 0x71b28df6 )
  2763.     ROM_LOAD_V20_EVEN( "22117-03.u26", 0x060000, 0x10000, 0x703d81ce )
  2764.     ROM_LOAD_V20_ODD ( "22114-03.u14", 0x060000, 0x10000, 0xf8b31bf8 )
  2765.     ROM_LOAD_V20_EVEN( "22118-03.u27", 0x0e0000, 0x10000, 0x806ccf8b )
  2766.     ROM_LOAD_V20_ODD ( "22115-03.u15", 0x0e0000, 0x10000, 0xc8439a7a )
  2767.  
  2768.     ROM_REGION( 0x18000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2769.     ROM_LOAD( "22105-01.u93", 0x00000, 0x08000, 0x4426e367 )
  2770.     ROM_LOAD( "22106-02.u94", 0x08000, 0x08000, 0x687dc1fc )
  2771.     ROM_LOAD( "22107-02.u95", 0x10000, 0x08000, 0xcee6ee5f )
  2772.  
  2773.     ROM_REGION( 0x20000, REGION_USER1 )   /* Ordering: 70/92/69/91/68/90/67/89 */
  2774.     /* 70 = empty */
  2775.     ROM_LOAD( "22104-01.u92",  0x04000, 0x4000, 0x03e0497d )
  2776.     ROM_LOAD( "22102-01.u69",  0x08000, 0x4000, 0xc3f2e443 )
  2777.     /* 91 = empty */
  2778.     /* 68 = empty */
  2779.     ROM_LOAD( "22103-02.u90",  0x14000, 0x4000, 0x2266757a )
  2780.     ROM_LOAD( "22101-01.u67",  0x18000, 0x4000, 0xecab0527 )
  2781.     /* 89 = empty */
  2782.  
  2783.     ROM_REGION( battery_ram_size, REGION_USER2 ) /* extra RAM regions */
  2784. ROM_END
  2785.  
  2786. ROM_START( offroadt )
  2787.     ROM_REGION( 0x040000, REGION_CPU1 )
  2788.     ROM_LOAD( "ortpu58.bin",   0x00000, 0x10000, 0xadbc6211 )
  2789.     ROM_LOAD( "ortpu59.bin",   0x10000, 0x10000, 0x296dd3b6 )
  2790.     ROM_LOAD( "ortpu57.bin",   0x20000, 0x10000, 0xe9f0f175 )
  2791.     ROM_LOAD( "ortpu56.bin",   0x30000, 0x10000, 0x2c1a22b3 )
  2792.  
  2793.     ROM_REGION( 0x90000, REGION_CPU2 )
  2794.     ROM_LOAD( "ortpu3b.bin", 0x00000, 0x02000, 0x95abb9f1 )
  2795.     ROM_LOAD( "ortpu2.bin",  0x10000, 0x10000, 0xc46c1627 )
  2796.     ROM_LOAD( "ortpu3.bin",  0x20000, 0x10000, 0x2276546f )
  2797.     ROM_LOAD( "ortpu4.bin",  0x30000, 0x10000, 0xaa4b5975 )
  2798.     ROM_LOAD( "ortpu5.bin",  0x40000, 0x10000, 0x69100b06 )
  2799.     ROM_LOAD( "ortpu6.bin",  0x50000, 0x10000, 0xb75015b8 )
  2800.     ROM_LOAD( "ortpu7.bin",  0x60000, 0x10000, 0xa5af5b4f )
  2801.     ROM_LOAD( "ortpu8.bin",  0x70000, 0x10000, 0x0f735078 )
  2802.  
  2803.     ROM_REGION( 0x100000, REGION_CPU3 )
  2804.     ROM_LOAD_V20_EVEN( "ortpu25.bin", 0x040000, 0x10000, 0xf952f800 )
  2805.     ROM_LOAD_V20_ODD ( "ortpu13.bin", 0x040000, 0x10000, 0x7beec9fc )
  2806.     ROM_LOAD_V20_EVEN( "ortpu26.bin", 0x060000, 0x10000, 0x6227ea94 )
  2807.     ROM_LOAD_V20_ODD ( "ortpu14.bin", 0x060000, 0x10000, 0x0a44331d )
  2808.     ROM_LOAD_V20_EVEN( "ortpu27.bin", 0x0e0000, 0x10000, 0xb80c5f99 )
  2809.     ROM_LOAD_V20_ODD ( "ortpu15.bin", 0x0e0000, 0x10000, 0x2a1a1c3c )
  2810.  
  2811.     ROM_REGION( 0x18000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2812.     ROM_LOAD( "ortpu93b.bin", 0x00000, 0x08000, 0xf0c1d8b0 )
  2813.     ROM_LOAD( "ortpu94b.bin", 0x08000, 0x08000, 0x7460d8c0 )
  2814.     ROM_LOAD( "ortpu95b.bin", 0x10000, 0x08000, 0x081ee7a8 )
  2815.  
  2816.     ROM_REGION( 0x20000, REGION_USER1 )   /* Ordering: 70/92/69/91/68/90/67/89 */
  2817.     /* 70 = empty */
  2818.     ROM_LOAD( "ortpu92b.bin",  0x04000, 0x4000, 0xf9988e28 )
  2819.     ROM_LOAD( "ortpu69b.bin",  0x08000, 0x4000, 0xfe5f8d8f )
  2820.     /* 91 = empty */
  2821.     /* 68 = empty */
  2822.     ROM_LOAD( "ortpu90b.bin",  0x14000, 0x4000, 0xbda2ecb1 )
  2823.     ROM_LOAD( "ortpu67b.bin",  0x18000, 0x4000, 0x38c9bf29 )
  2824.     /* 89 = empty */
  2825.  
  2826.     ROM_REGION( battery_ram_size, REGION_USER2 ) /* extra RAM regions */
  2827. ROM_END
  2828.  
  2829. ROM_START( pigout )
  2830.     ROM_REGION( 0x040000, REGION_CPU1 )
  2831.     ROM_LOAD( "poutu58t.bin",  0x00000, 0x10000, 0x8fe4b683 )
  2832.     ROM_LOAD( "poutu59t.bin",  0x10000, 0x10000, 0xab907762 )
  2833.     ROM_LOAD( "poutu57t.bin",  0x20000, 0x10000, 0xc22be0ff )
  2834.  
  2835.     ROM_REGION( 0x080000, REGION_CPU2 )
  2836.     ROM_LOAD( "poutu3.bin",   0x00000, 0x02000, 0xaf213cb7 )
  2837.     ROM_LOAD( "poutu2t.bin",  0x10000, 0x10000, 0xb23164c6 )
  2838.     ROM_LOAD( "poutu3t.bin",  0x20000, 0x10000, 0xd93f105f )
  2839.     ROM_LOAD( "poutu4t.bin",  0x30000, 0x10000, 0xb7c47bfe )
  2840.     ROM_LOAD( "poutu5t.bin",  0x40000, 0x10000, 0xd9b9dfbf )
  2841.     ROM_LOAD( "poutu6t.bin",  0x50000, 0x10000, 0x728c7c1a )
  2842.     ROM_LOAD( "poutu7t.bin",  0x60000, 0x10000, 0x393bd990 )
  2843.     ROM_LOAD( "poutu8t.bin",  0x70000, 0x10000, 0xcb9ffaad )
  2844.  
  2845.     ROM_REGION( 0x100000, REGION_CPU3 )
  2846.     ROM_LOAD_V20_EVEN( "poutu25t.bin", 0x040000, 0x10000, 0x92cd2617 )
  2847.     ROM_LOAD_V20_ODD ( "poutu13t.bin", 0x040000, 0x10000, 0x9448c389 )
  2848.     ROM_LOAD_V20_EVEN( "poutu26t.bin", 0x060000, 0x10000, 0xab57de8f )
  2849.     ROM_LOAD_V20_ODD ( "poutu14t.bin", 0x060000, 0x10000, 0x30678e93 )
  2850.     ROM_LOAD_V20_EVEN( "poutu27t.bin", 0x0e0000, 0x10000, 0x37a8156e )
  2851.     ROM_LOAD_V20_ODD ( "poutu15t.bin", 0x0e0000, 0x10000, 0x1c60d58b )
  2852.  
  2853.     ROM_REGION( 0x18000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2854.     ROM_LOAD( "poutu93.bin", 0x000000, 0x08000, 0xf102a04d )
  2855.     ROM_LOAD( "poutu94.bin", 0x008000, 0x08000, 0xec63c015 )
  2856.     ROM_LOAD( "poutu95.bin", 0x010000, 0x08000, 0xba6e797e )
  2857.  
  2858.     ROM_REGION( 0x40000, REGION_USER1 )   /* Ordering: 70/92/69/91/68/90/67/89 */
  2859.     ROM_LOAD( "poutu70.bin",  0x00000, 0x4000, 0x7db4eaa1 )
  2860.     ROM_LOAD( "poutu92.bin",  0x04000, 0x4000, 0x20fa57bb )
  2861.     ROM_LOAD( "poutu69.bin",  0x08000, 0x4000, 0xa16886f3 )
  2862.     ROM_LOAD( "poutu91.bin",  0x0c000, 0x4000, 0x482a3581 )
  2863.     ROM_LOAD( "poutu68.bin",  0x10000, 0x4000, 0x7b62a3ed )
  2864.     ROM_LOAD( "poutu90.bin",  0x14000, 0x4000, 0x9615d710 )
  2865.     ROM_LOAD( "poutu67.bin",  0x18000, 0x4000, 0xaf85ce79 )
  2866.     ROM_LOAD( "poutu89.bin",  0x1c000, 0x4000, 0x6c874a05 )
  2867.  
  2868.     ROM_REGION( battery_ram_size, REGION_USER2 ) /* extra RAM regions */
  2869. ROM_END
  2870.  
  2871. ROM_START( pigouta )
  2872.     ROM_REGION( 0x040000, REGION_CPU1 )
  2873.     ROM_LOAD( "03-29020.01", 0x00000, 0x10000, 0x6c815982 )
  2874.     ROM_LOAD( "03-29021.01", 0x10000, 0x10000, 0x9de7a763 )
  2875.     ROM_LOAD( "poutu57t.bin", 0x20000, 0x10000, 0xc22be0ff )
  2876.  
  2877.     ROM_REGION( 0x80000, REGION_CPU2 )
  2878.     ROM_LOAD( "poutu3.bin",   0x00000, 0x02000, 0xaf213cb7 )
  2879.     ROM_LOAD( "poutu2t.bin",  0x10000, 0x10000, 0xb23164c6 )
  2880.     ROM_LOAD( "poutu3t.bin",  0x20000, 0x10000, 0xd93f105f )
  2881.     ROM_LOAD( "poutu4t.bin",  0x30000, 0x10000, 0xb7c47bfe )
  2882.     ROM_LOAD( "poutu5t.bin",  0x40000, 0x10000, 0xd9b9dfbf )
  2883.     ROM_LOAD( "poutu6t.bin",  0x50000, 0x10000, 0x728c7c1a )
  2884.     ROM_LOAD( "poutu7t.bin",  0x60000, 0x10000, 0x393bd990 )
  2885.     ROM_LOAD( "poutu8t.bin",  0x70000, 0x10000, 0xcb9ffaad )
  2886.  
  2887.     ROM_REGION( 0x100000, REGION_CPU3 )
  2888.     ROM_LOAD_V20_EVEN( "poutu25t.bin", 0x040000, 0x10000, 0x92cd2617 )
  2889.     ROM_LOAD_V20_ODD ( "poutu13t.bin", 0x040000, 0x10000, 0x9448c389 )
  2890.     ROM_LOAD_V20_EVEN( "poutu26t.bin", 0x060000, 0x10000, 0xab57de8f )
  2891.     ROM_LOAD_V20_ODD ( "poutu14t.bin", 0x060000, 0x10000, 0x30678e93 )
  2892.     ROM_LOAD_V20_EVEN( "poutu27t.bin", 0x0e0000, 0x10000, 0x37a8156e )
  2893.     ROM_LOAD_V20_ODD ( "poutu15t.bin", 0x0e0000, 0x10000, 0x1c60d58b )
  2894.  
  2895.     ROM_REGION( 0x18000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2896.     ROM_LOAD( "poutu93.bin", 0x000000, 0x08000, 0xf102a04d )
  2897.     ROM_LOAD( "poutu94.bin", 0x008000, 0x08000, 0xec63c015 )
  2898.     ROM_LOAD( "poutu95.bin", 0x010000, 0x08000, 0xba6e797e )
  2899.  
  2900.     ROM_REGION( 0x40000, REGION_USER1 )   /* Ordering: 70/92/69/91/68/90/67/89 */
  2901.     ROM_LOAD( "poutu70.bin",  0x00000, 0x4000, 0x7db4eaa1 )
  2902.     ROM_LOAD( "poutu92.bin",  0x04000, 0x4000, 0x20fa57bb )
  2903.     ROM_LOAD( "poutu69.bin",  0x08000, 0x4000, 0xa16886f3 )
  2904.     ROM_LOAD( "poutu91.bin",  0x0c000, 0x4000, 0x482a3581 )
  2905.     ROM_LOAD( "poutu68.bin",  0x10000, 0x4000, 0x7b62a3ed )
  2906.     ROM_LOAD( "poutu90.bin",  0x14000, 0x4000, 0x9615d710 )
  2907.     ROM_LOAD( "poutu67.bin",  0x18000, 0x4000, 0xaf85ce79 )
  2908.     ROM_LOAD( "poutu89.bin",  0x1c000, 0x4000, 0x6c874a05 )
  2909.  
  2910.     ROM_REGION( battery_ram_size, REGION_USER2 ) /* extra RAM regions */
  2911. ROM_END
  2912.  
  2913.  
  2914.  
  2915. /*************************************
  2916.  *
  2917.  *    Driver initialization
  2918.  *
  2919.  *************************************/
  2920.  
  2921. /* also called by Ataxx */
  2922. void leland_rotate_memory(int cpunum)
  2923. {
  2924.     int startaddr = 0x10000;
  2925.     int banks = (memory_region_length(REGION_CPU1 + cpunum) - startaddr) / 0x8000;
  2926.     UINT8 *ram = memory_region(REGION_CPU1 + cpunum);
  2927.     UINT8 temp[0x2000];
  2928.     int i;
  2929.  
  2930.     for (i = 0; i < banks; i++)
  2931.     {
  2932.         memmove(temp, &ram[startaddr + 0x0000], 0x2000);
  2933.         memmove(&ram[startaddr + 0x0000], &ram[startaddr + 0x2000], 0x6000);
  2934.         memmove(&ram[startaddr + 0x6000], temp, 0x2000);
  2935.         startaddr += 0x8000;
  2936.     }
  2937. }
  2938.  
  2939.  
  2940. #ifdef MAME_DEBUG
  2941. /*
  2942. Copy this code into the init function and modify:
  2943. {
  2944.     UINT8 *ram = memory_region(REGION_CPU1);
  2945.     FILE *output;
  2946.  
  2947.     output = fopen("indyheat.m", "w");
  2948.     dasm_chunk("Resident",         &ram[0x00000], 0x0000, 0x2000, output);
  2949.     dasm_chunk("Bank 0x02000:", &ram[0x02000], 0x2000, 0x8000, output);
  2950.     dasm_chunk("Bank 0x10000:", &ram[0x10000], 0x2000, 0x8000, output);
  2951.     dasm_chunk("Bank 0x18000:", &ram[0x18000], 0x2000, 0x8000, output);
  2952.     dasm_chunk("Bank 0x20000:", &ram[0x20000], 0x2000, 0x8000, output);
  2953.     dasm_chunk("Bank 0x28000:", &ram[0x28000], 0x2000, 0x8000, output);
  2954.     dasm_chunk("Bank 0x30000:", &ram[0x30000], 0x2000, 0x8000, output);
  2955.     dasm_chunk("Bank 0x38000:", &ram[0x38000], 0x2000, 0x8000, output);
  2956.     dasm_chunk("Bank 0x40000:", &ram[0x40000], 0x2000, 0x8000, output);
  2957.     dasm_chunk("Bank 0x48000:", &ram[0x48000], 0x2000, 0x8000, output);
  2958.     dasm_chunk("Bank 0x50000:", &ram[0x50000], 0x2000, 0x8000, output);
  2959.     dasm_chunk("Bank 0x58000:", &ram[0x58000], 0x2000, 0x8000, output);
  2960.     dasm_chunk("Bank 0x60000:", &ram[0x60000], 0x2000, 0x8000, output);
  2961.     dasm_chunk("Bank 0x68000:", &ram[0x68000], 0x2000, 0x8000, output);
  2962.     dasm_chunk("Bank 0x70000:", &ram[0x70000], 0x2000, 0x8000, output);
  2963.     dasm_chunk("Bank 0x78000:", &ram[0x78000], 0x2000, 0x8000, output);
  2964.     fclose(output);
  2965. }
  2966. */
  2967. static void dasm_chunk(char *tag, UINT8 *base, UINT16 pc, UINT32 length, FILE *output)
  2968. {
  2969.     extern unsigned DasmZ80(char *buffer, unsigned _pc);
  2970.  
  2971.     UINT8 *old_rom = OP_ROM;
  2972.     UINT8 *old_ram = OP_RAM;
  2973.     char buffer[256];
  2974.     int count, offset, i;
  2975.  
  2976.     fprintf(output, "\n\n\n%s:\n", tag);
  2977.     OP_ROM = OP_RAM = &base[-pc];
  2978.     for (offset = 0; offset < length; offset += count)
  2979.     {
  2980.         count = DasmZ80(buffer, pc);
  2981.         for (i = 0; i < 4; i++)
  2982.             if (i < count)
  2983.                 fprintf(output, "%c", (OP_ROM[pc + i] >= 32 && OP_ROM[pc + i] < 127) ? OP_ROM[pc + i] : ' ');
  2984.             else
  2985.                 fprintf(output, " ");
  2986.         fprintf(output, " %04X: ", pc);
  2987.         for (i = 0; i < 4; i++)
  2988.             if (i < count)
  2989.                 fprintf(output, "%02X ", OP_ROM[pc++]);
  2990.             else
  2991.                 fprintf(output, "   ");
  2992.         fprintf(output, "%s\n", buffer);
  2993.     }
  2994.     OP_ROM = old_rom;
  2995.     OP_RAM = old_ram;
  2996. }
  2997. #endif
  2998.  
  2999.  
  3000. static void init_master_ports(UINT8 mvram_base, UINT8 io_base)
  3001. {
  3002.     /* set up the master CPU VRAM I/O */
  3003.     install_port_read_handler(0, mvram_base, mvram_base + 0x1f, leland_mvram_port_r);
  3004.     install_port_write_handler(0, mvram_base, mvram_base + 0x1f, leland_mvram_port_w);
  3005.  
  3006.     /* set up the master CPU I/O ports */
  3007.     install_port_read_handler(0, io_base, io_base + 0x1f, master_input_r);
  3008.     install_port_write_handler(0, io_base, io_base + 0x0f, master_output_w);
  3009. }
  3010.  
  3011.  
  3012. static void init_cerberus(void)
  3013. {
  3014.     /* initialize the default EEPROM state */
  3015.     static const UINT16 cerberus_eeprom_data[] =
  3016.     {
  3017.         0x05,0x0001,
  3018.         0x06,0x0001,
  3019.         0x07,0x0001,
  3020.         0x08,0x0001,
  3021.         0x09,0x0004,
  3022.         0x0a,0x0004,
  3023.         0x0e,0x0001,
  3024.         0x0f,0x0003,
  3025.         0x10,0x0500,
  3026.         0x12,0x0005,
  3027.         0x13,0x0003,
  3028.         0x3f,0x001d,
  3029.         0xffff
  3030.     };
  3031.     init_eeprom(0x00, cerberus_eeprom_data, 0, SERIAL_TYPE_NONE);
  3032.  
  3033.     /* master CPU bankswitching */
  3034.     update_master_bank = cerberus_bankswitch;
  3035.  
  3036.     /* set up the master CPU I/O ports */
  3037.     init_master_ports(0x40, 0x80);
  3038.  
  3039.     /* set up additional input ports */
  3040.     install_port_read_handler(0, 0x80, 0x80, cerberus_dial_1_r);
  3041.     install_port_read_handler(0, 0x90, 0x90, cerberus_dial_2_r);
  3042. }
  3043.  
  3044. static void init_mayhem(void)
  3045. {
  3046.     /* initialize the default EEPROM state */
  3047.     static const UINT16 mayhem_eeprom_data[] =
  3048.     {
  3049.         0x05,0x0001,
  3050.         0x06,0x0001,
  3051.         0x07,0x0001,
  3052.         0x08,0x0001,
  3053.         0x09,0x0004,
  3054.         0x0a,0x0004,
  3055.         0x0c,0xff00,
  3056.         0x13,0x28ff,
  3057.         0x14,0x0023,
  3058.         0x15,0x0005,
  3059.         0x1b,0x0060,
  3060.         0x1c,0x4a00,
  3061.         0x1d,0x4520,
  3062.         0x1e,0x4943,
  3063.         0x1f,0x454e,
  3064.         0x20,0x414d,
  3065.         0x21,0x5254,
  3066.         0x22,0x4e4f,
  3067.         0x23,0x4349,
  3068.         0x24,0x2053,
  3069.         0x25,0x2020,
  3070.         0x26,0x2020,
  3071.         0x27,0x2020,
  3072.         0x3f,0x0818,
  3073.         0xffff
  3074.     };
  3075.     init_eeprom(0x00, mayhem_eeprom_data, 0x28, SERIAL_TYPE_ADD);
  3076.  
  3077.     /* master CPU bankswitching */
  3078.     update_master_bank = mayhem_bankswitch;
  3079.  
  3080.     /* set up the master CPU I/O ports */
  3081.     init_master_ports(0x00, 0xc0);
  3082. }
  3083.  
  3084. static void init_wseries(void)
  3085. {
  3086.     /* initialize the default EEPROM state */
  3087.     static const UINT16 wseries_eeprom_data[] =
  3088.     {
  3089.         0x19,0xfefe,
  3090.         0x1a,0xfefe,
  3091.         0x1b,0xfbfb,
  3092.         0x1d,0x00ff,
  3093.         0xffff
  3094.     };
  3095.     init_eeprom(0xff, wseries_eeprom_data, 0x12, SERIAL_TYPE_ENCRYPT_XOR);
  3096.  
  3097.     /* master CPU bankswitching */
  3098.     update_master_bank = mayhem_bankswitch;
  3099.  
  3100.     /* set up the master CPU I/O ports */
  3101.     init_master_ports(0x40, 0x80);
  3102. }
  3103.  
  3104. static void init_alleymas(void)
  3105. {
  3106.     /* initialize the default EEPROM state */
  3107.     static const UINT16 alleymas_eeprom_data[] =
  3108.     {
  3109.         0x13,0xfefe,
  3110.         0x14,0xfefe,
  3111.         0x15,0xfbfb,
  3112.         0x17,0x00ff,
  3113.         0x18,0xff00,
  3114.         0x37,0x00ff,
  3115.         0xffff
  3116.     };
  3117.     init_eeprom(0xff, alleymas_eeprom_data, 0x0c, SERIAL_TYPE_ENCRYPT_XOR);
  3118.  
  3119.     /* master CPU bankswitching */
  3120.     update_master_bank = mayhem_bankswitch;
  3121.  
  3122.     /* set up the master CPU I/O ports */
  3123.     init_master_ports(0x00, 0xc0);
  3124.  
  3125.     /* kludge warning: the game uses location E0CA to determine if the joysticks are available */
  3126.     /* it gets cleared by the code, but there is no obvious way for the value to be set to a */
  3127.     /* non-zero value. If the value is zero, the joystick is never read. */
  3128.     alleymas_kludge_mem = install_mem_write_handler(0, 0xe0ca, 0xe0ca, alleymas_joystick_kludge);
  3129. }
  3130.  
  3131. static void init_dangerz(void)
  3132. {
  3133.     /* initialize the default EEPROM state */
  3134.     static const UINT16 dangerz_eeprom_data[] =
  3135.     {
  3136.         0x17,0xfefe,
  3137.         0x18,0xfefe,
  3138.         0x19,0xfbfb,
  3139.         0x1b,0x00ff,
  3140.         0x1c,0xfffa,
  3141.         0x38,0xb6bc,
  3142.         0x39,0xffb1,
  3143.         0x3a,0x8007,
  3144.         0xffff
  3145.     };
  3146.     init_eeprom(0xff, dangerz_eeprom_data, 0x10, SERIAL_TYPE_ENCRYPT_XOR);
  3147.  
  3148.     /* master CPU bankswitching */
  3149.     update_master_bank = dangerz_bankswitch;
  3150.  
  3151.     /* set up the master CPU I/O ports */
  3152.     init_master_ports(0x40, 0x80);
  3153.  
  3154.     /* set up additional input ports */
  3155.     install_port_read_handler(0, 0xf4, 0xf4, dangerz_input_upper_r);
  3156.     install_port_read_handler(0, 0xf8, 0xf8, dangerz_input_y_r);
  3157.     install_port_read_handler(0, 0xfc, 0xfc, dangerz_input_x_r);
  3158. }
  3159.  
  3160. static void init_basebal2(void)
  3161. {
  3162.     /* initialize the default EEPROM state */
  3163.     static const UINT16 basebal2_eeprom_data[] =
  3164.     {
  3165.         0x19,0xfefe,
  3166.         0x1a,0xfefe,
  3167.         0x1b,0xfbfb,
  3168.         0x1d,0x00ff,
  3169.         0xffff
  3170.     };
  3171.     init_eeprom(0xff, basebal2_eeprom_data, 0x12, SERIAL_TYPE_ENCRYPT_XOR);
  3172.  
  3173.     /* master CPU bankswitching */
  3174.     update_master_bank = basebal2_bankswitch;
  3175.  
  3176.     /* set up the master CPU I/O ports */
  3177.     init_master_ports(0x00, 0xc0);
  3178. }
  3179.  
  3180. static void init_dblplay(void)
  3181. {
  3182.     /* initialize the default EEPROM state */
  3183.     static const UINT16 dblplay_eeprom_data[] =
  3184.     {
  3185.         0x18,0xfefe,
  3186.         0x19,0xfefe,
  3187.         0x1a,0xfbfb,
  3188.         0x1c,0x00ff,
  3189.         0x3b,0xffe1,
  3190.         0xffff
  3191.     };
  3192.     init_eeprom(0xff, dblplay_eeprom_data, 0x11, SERIAL_TYPE_ENCRYPT_XOR);
  3193.  
  3194.     /* master CPU bankswitching */
  3195.     update_master_bank = basebal2_bankswitch;
  3196.  
  3197.     /* set up the master CPU I/O ports */
  3198.     init_master_ports(0x80, 0x40);
  3199. }
  3200.  
  3201. static void init_strkzone(void)
  3202. {
  3203.     /* initialize the default EEPROM state */
  3204.     static const UINT16 strkzone_eeprom_data[] =
  3205.     {
  3206.         0x16,0xfefe,
  3207.         0x17,0xfefe,
  3208.         0x18,0xfbfb,
  3209.         0x1a,0x00ff,
  3210.         0x1b,0xffe1,
  3211.         0xffff
  3212.     };
  3213.     init_eeprom(0xff, strkzone_eeprom_data, 0x0f, SERIAL_TYPE_ENCRYPT_XOR);
  3214.  
  3215.     /* master CPU bankswitching */
  3216.     update_master_bank = basebal2_bankswitch;
  3217.  
  3218.     /* set up the master CPU I/O ports */
  3219.     init_master_ports(0x00, 0x40);
  3220. }
  3221.  
  3222. static void init_redlin2p(void)
  3223. {
  3224.     /* initialize the default EEPROM state */
  3225.     static const UINT16 redlin2p_eeprom_data[] =
  3226.     {
  3227.         0x1f,0xfefe,
  3228.         0x20,0xfffb,
  3229.         0x21,0xfa00,
  3230.         0x22,0xfffe,
  3231.         0xffff
  3232.     };
  3233.     init_eeprom(0xff, redlin2p_eeprom_data, 0x18, SERIAL_TYPE_ENCRYPT_XOR);
  3234.  
  3235.     /* master CPU bankswitching */
  3236.     update_master_bank = redline_bankswitch;
  3237.  
  3238.     leland_rotate_memory(0);
  3239.  
  3240.     /* set up the master CPU I/O ports */
  3241.     init_master_ports(0x00, 0xc0);
  3242.  
  3243.     /* set up additional input ports */
  3244.     install_port_read_handler(0, 0xc0, 0xc0, redline_pedal_1_r);
  3245.     install_port_read_handler(0, 0xd0, 0xd0, redline_pedal_2_r);
  3246.     install_port_read_handler(0, 0xf8, 0xf8, redline_wheel_2_r);
  3247.     install_port_read_handler(0, 0xfb, 0xfb, redline_wheel_1_r);
  3248.  
  3249.     /* optimize the sound */
  3250.     leland_i86_optimize_address(0x828);
  3251. }
  3252.  
  3253. static void init_quarterb(void)
  3254. {
  3255.     /* initialize the default EEPROM state */
  3256.     static const UINT16 quarterb_eeprom_data[] =
  3257.     {
  3258.         0x34,0xfefe,
  3259.         0x35,0xfefe,
  3260.         0x36,0xfbfb,
  3261.         0x38,0x00ff,
  3262.         0x39,0x53ff,
  3263.         0x3a,0xffd9,
  3264.         0xffff
  3265.     };
  3266.     init_eeprom(0xff, quarterb_eeprom_data, 0x24, SERIAL_TYPE_ENCRYPT_XOR);
  3267.  
  3268.     /* master CPU bankswitching */
  3269.     update_master_bank = viper_bankswitch;
  3270.  
  3271.     leland_rotate_memory(0);
  3272.  
  3273.     /* set up the master CPU I/O ports */
  3274.     init_master_ports(0x40, 0x80);
  3275.  
  3276.     /* optimize the sound */
  3277.     leland_i86_optimize_address(0x9bc);
  3278. }
  3279.  
  3280. static void init_viper(void)
  3281. {
  3282.     /* initialize the default EEPROM state */
  3283.     static const UINT16 viper_eeprom_data[] =
  3284.     {
  3285.         0x13,0xfefe,
  3286.         0x14,0xfefe,
  3287.         0x15,0xfbfb,
  3288.         0x17,0x00ff,
  3289.         0x18,0xfcfa,
  3290.         0x1b,0xfffe,
  3291.         0xffff
  3292.     };
  3293.     init_eeprom(0xff, viper_eeprom_data, 0x0c, SERIAL_TYPE_ENCRYPT_XOR);
  3294.  
  3295.     /* master CPU bankswitching */
  3296.     update_master_bank = viper_bankswitch;
  3297.  
  3298.     leland_rotate_memory(0);
  3299.     leland_rotate_memory(1);
  3300.     leland_rotate_memory(1);
  3301.  
  3302.     /* set up the master CPU I/O ports */
  3303.     init_master_ports(0x00, 0xc0);
  3304.  
  3305.     /* set up additional input ports */
  3306.     install_port_read_handler(0, 0xa4, 0xa4, dangerz_input_upper_r);
  3307.     install_port_read_handler(0, 0xb8, 0xb8, dangerz_input_y_r);
  3308.     install_port_read_handler(0, 0xbc, 0xbc, dangerz_input_x_r);
  3309.  
  3310.     /* optimize the sound */
  3311.     leland_i86_optimize_address(0x788);
  3312. }
  3313.  
  3314. static void init_teamqb(void)
  3315. {
  3316.     /* initialize the default EEPROM state */
  3317.     static const UINT16 teamqb_eeprom_data[] =
  3318.     {
  3319.         0x36,0xfefe,
  3320.         0x37,0xfefe,
  3321.         0x38,0xfbfb,
  3322.         0x3a,0x5300,
  3323.         0x3b,0xffd9,
  3324.         0xffff
  3325.     };
  3326.     init_eeprom(0xff, teamqb_eeprom_data, 0x1a, SERIAL_TYPE_ENCRYPT_XOR);
  3327.  
  3328.     /* master CPU bankswitching */
  3329.     update_master_bank = viper_bankswitch;
  3330.  
  3331.     leland_rotate_memory(0);
  3332.     leland_rotate_memory(1);
  3333.     leland_rotate_memory(1);
  3334.  
  3335.     /* set up the master CPU I/O ports */
  3336.     init_master_ports(0x40, 0x80);
  3337.  
  3338.     /* set up additional input ports */
  3339.     install_port_read_handler(0, 0x7c, 0x7c, input_port_10_r);
  3340.     install_port_read_handler(0, 0x7f, 0x7f, input_port_11_r);
  3341.  
  3342.     /* optimize the sound */
  3343.     leland_i86_optimize_address(0x788);
  3344. }
  3345.  
  3346. static void init_aafb(void)
  3347. {
  3348.     /* initialize the default EEPROM state */
  3349.     static const UINT16 aafb_eeprom_data[] =
  3350.     {
  3351.         0x36,0xfefe,
  3352.         0x37,0xfefe,
  3353.         0x38,0xfbfb,
  3354.         0x3a,0x5300,
  3355.         0x3b,0xffd9,
  3356.         0xffff
  3357.     };
  3358.     init_eeprom(0xff, aafb_eeprom_data, 0x1a, SERIAL_TYPE_ENCRYPT_XOR);
  3359.  
  3360.     /* master CPU bankswitching */
  3361.     update_master_bank = viper_bankswitch;
  3362.  
  3363.     leland_rotate_memory(0);
  3364.     leland_rotate_memory(1);
  3365.     leland_rotate_memory(1);
  3366.  
  3367.     /* set up the master CPU I/O ports */
  3368.     init_master_ports(0x00, 0xc0);
  3369.  
  3370.     /* set up additional input ports */
  3371.     install_port_read_handler(0, 0x7c, 0x7c, input_port_10_r);
  3372.     install_port_read_handler(0, 0x7f, 0x7f, input_port_11_r);
  3373.  
  3374.     /* optimize the sound */
  3375.     leland_i86_optimize_address(0x788);
  3376. }
  3377.  
  3378. static void init_aafbb(void)
  3379. {
  3380.     /* initialize the default EEPROM state */
  3381.     static const UINT16 aafb_eeprom_data[] =
  3382.     {
  3383.         0x36,0xfefe,
  3384.         0x37,0xfefe,
  3385.         0x38,0xfbfb,
  3386.         0x3a,0x5300,
  3387.         0x3b,0xffd9,
  3388.         0xffff
  3389.     };
  3390.     init_eeprom(0xff, aafb_eeprom_data, 0x1a, SERIAL_TYPE_ENCRYPT_XOR);
  3391.  
  3392.     /* master CPU bankswitching */
  3393.     update_master_bank = viper_bankswitch;
  3394.  
  3395.     leland_rotate_memory(0);
  3396.     leland_rotate_memory(1);
  3397.     leland_rotate_memory(1);
  3398.  
  3399.     /* set up the master CPU I/O ports */
  3400.     init_master_ports(0x00, 0x40);
  3401.  
  3402.     /* set up additional input ports */
  3403.     install_port_read_handler(0, 0x7c, 0x7c, input_port_10_r);
  3404.     install_port_read_handler(0, 0x7f, 0x7f, input_port_11_r);
  3405.  
  3406.     /* optimize the sound */
  3407.     leland_i86_optimize_address(0x788);
  3408. }
  3409.  
  3410. static void init_offroad(void)
  3411. {
  3412.     /* initialize the default EEPROM state */
  3413.     static const UINT16 offroad_eeprom_data[] =
  3414.     {
  3415.         0x09,0xfefe,
  3416.         0x0a,0xfffb,
  3417.         0x0d,0x00ff,
  3418.         0x0e,0xfffb,
  3419.         0x36,0xfeff,
  3420.         0x37,0xfefe,
  3421.         0x38,0xfffe,
  3422.         0x39,0x50ff,
  3423.         0x3a,0x976c,
  3424.         0x3b,0xffad,
  3425.         0xffff
  3426.     };
  3427.     init_eeprom(0xff, offroad_eeprom_data, 0x00, SERIAL_TYPE_ENCRYPT_XOR);
  3428.  
  3429.     /* master CPU bankswitching */
  3430.     update_master_bank = offroad_bankswitch;
  3431.  
  3432.     leland_rotate_memory(0);
  3433.     leland_rotate_memory(1);
  3434.     leland_rotate_memory(1);
  3435.  
  3436.     /* set up the master CPU I/O ports */
  3437.     init_master_ports(0x00, 0xc0);
  3438.     init_master_ports(0x40, 0x80);    /* yes, this is intentional */
  3439.  
  3440.     /* set up additional input ports */
  3441.     install_port_read_handler(0, 0xf8, 0xf8, offroad_wheel_3_r);
  3442.     install_port_read_handler(0, 0xf9, 0xf9, offroad_wheel_1_r);
  3443.     install_port_read_handler(0, 0xfb, 0xfb, offroad_wheel_2_r);
  3444.  
  3445.     /* optimize the sound */
  3446.     leland_i86_optimize_address(0x788);
  3447. }
  3448.  
  3449. static void init_offroadt(void)
  3450. {
  3451.     /* initialize the default EEPROM state */
  3452.     static const UINT16 offroadt_eeprom_data[] =
  3453.     {
  3454.         0x09,0xfefe,
  3455.         0x0a,0xfffb,
  3456.         0x0d,0x00ff,
  3457.         0x0e,0xfffb,
  3458.         0x36,0xfeff,
  3459.         0x37,0xfefe,
  3460.         0x38,0xfffe,
  3461.         0x39,0x50ff,
  3462.         0x3a,0x976c,
  3463.         0x3b,0xffad,
  3464.         0xffff
  3465.     };
  3466.     init_eeprom(0xff, offroadt_eeprom_data, 0x00, SERIAL_TYPE_ENCRYPT_XOR);
  3467.  
  3468.     /* master CPU bankswitching */
  3469.     update_master_bank = offroad_bankswitch;
  3470.  
  3471.     leland_rotate_memory(0);
  3472.     leland_rotate_memory(1);
  3473.     leland_rotate_memory(1);
  3474.  
  3475.     /* set up the master CPU I/O ports */
  3476.     init_master_ports(0x80, 0x40);
  3477.  
  3478.     /* set up additional input ports */
  3479.     install_port_read_handler(0, 0xf8, 0xf8, offroad_wheel_3_r);
  3480.     install_port_read_handler(0, 0xf9, 0xf9, offroad_wheel_1_r);
  3481.     install_port_read_handler(0, 0xfb, 0xfb, offroad_wheel_2_r);
  3482.  
  3483.     /* optimize the sound */
  3484.     leland_i86_optimize_address(0x788);
  3485. }
  3486.  
  3487. static void init_pigout(void)
  3488. {
  3489.     /* initialize the default EEPROM state */
  3490.     static const UINT16 pigout_eeprom_data[] =
  3491.     {
  3492.         0x09,0xfefe,
  3493.         0x0a,0xfefb,
  3494.         0x0b,0xfffe,
  3495.         0x0c,0xfefe,
  3496.         0x0d,0xfffb,
  3497.         0x39,0xfcff,
  3498.         0x3a,0xfb00,
  3499.         0x3b,0xfffc,
  3500.         0xffff
  3501.     };
  3502.     init_eeprom(0xff, pigout_eeprom_data, 0x00, SERIAL_TYPE_ENCRYPT);
  3503.  
  3504.     /* master CPU bankswitching */
  3505.     update_master_bank = offroad_bankswitch;
  3506.  
  3507.     leland_rotate_memory(0);
  3508.     leland_rotate_memory(1);
  3509.     leland_rotate_memory(1);
  3510.  
  3511.     /* set up the master CPU I/O ports */
  3512.     init_master_ports(0x00, 0x40);
  3513.  
  3514.     /* set up additional input ports */
  3515.     install_port_read_handler(0, 0x7f, 0x7f, input_port_4_r);
  3516.  
  3517.     /* optimize the sound */
  3518.     leland_i86_optimize_address(0x788);
  3519. }
  3520.  
  3521.  
  3522.  
  3523. /*************************************
  3524.  *
  3525.  *    Game drivers
  3526.  *
  3527.  *************************************/
  3528.  
  3529. /* small master banks, small slave banks */
  3530. GAME( 1985, cerberus, 0,       leland,  cerberus, cerberus, ROT0,   "Cinematronics", "Cerberus" )
  3531. GAME( 1985, mayhem,   0,       leland,  mayhem,   mayhem,   ROT0,   "Cinematronics", "Mayhem 2002" )
  3532. GAME( 1985, wseries,  0,       leland,  wseries,  wseries,  ROT0,   "Cinematronics", "World Series: The Season" )
  3533. GAME( 1986, alleymas, 0,       leland,  alleymas, alleymas, ROT270, "Cinematronics", "Alley Master" )
  3534.  
  3535. /* odd master banks, small slave banks */
  3536. GAME( 1986, dangerz,  0,       leland,  dangerz,  dangerz,  ROT0,   "Cinematronics", "Danger Zone" )
  3537.  
  3538. /* small master banks + extra top board, small slave banks */
  3539. GAME( 1987, basebal2, 0,       leland,  basebal2, basebal2, ROT0,   "Cinematronics", "Baseball The Season II" )
  3540. GAME( 1987, dblplay,  0,       leland,  basebal2, dblplay,  ROT0,   "Leland Corp. / Tradewest", "Super Baseball Double Play Home Run Derby" )
  3541. GAME( 1988, strkzone, 0,       leland,  basebal2, strkzone, ROT0,   "Leland Corp.", "Strike Zone" )
  3542.  
  3543. /* large master banks, small slave banks, I86 sound */
  3544. GAME( 1987, redlin2p, 0,       redline, redline,  redlin2p, ROT270, "Cinematronics (Tradewest license)", "Redline Racer (2 players)" )
  3545. GAME( 1987, quarterb, 0,       quarterb,quarterb, quarterb, ROT270, "Leland Corp.", "Quarterback" )
  3546. GAME( 1987, quartrba, quarterb,quarterb,quarterb, quarterb, ROT270, "Leland Corp.", "Quarterback (set 2)" )
  3547.  
  3548. /* large master banks, large slave banks, I86 sound */
  3549. GAME( 1988, viper,    0,       lelandi, dangerz,  viper,    ROT0,   "Leland Corp.", "Viper" )
  3550. GAME( 1988, teamqb,   0,       lelandi, teamqb,   teamqb,   ROT270, "Leland Corp.", "John Elway's Team Quarterback" )
  3551. GAME( 1988, teamqb2,  teamqb,  lelandi, teamqb,   teamqb,   ROT270, "Leland Corp.", "John Elway's Team Quarterback (set 2)" )
  3552. GAME( 1989, aafb,     0,       lelandi, teamqb,   aafb,     ROT270, "Leland Corp.", "All American Football (rev E)" )
  3553. GAME( 1989, aafbd2p,  aafb,    lelandi, aafb2p,   aafbb,    ROT270, "Leland Corp.", "All American Football (rev D, 2 Players)" )
  3554. GAME( 1989, aafbb,    aafb,    lelandi, teamqb,   aafbb,    ROT270, "Leland Corp.", "All American Football (rev B)" )
  3555.  
  3556. /* huge master banks, large slave banks, I86 sound */
  3557. GAME( 1989, offroad,  0,       lelandi, offroad,  offroad,  ROT0,   "Leland Corp.", "Ironman Stewart's Super Off-Road" )
  3558. GAME( 1989, offroadt, 0,       lelandi, offroad,  offroadt, ROT0,   "Leland Corp.", "Ironman Stewart's Super Off-Road Track Pack" )
  3559. GAME( 1990, pigout,   0,       lelandi, pigout,   pigout,   ROT0,   "Leland Corp.", "Pigout" )
  3560. GAME( 1990, pigouta,  pigout,  lelandi, pigout,   pigout,   ROT0,   "Leland Corp.", "Pigout (alternate)" )
  3561.